A command-line tool for performing zero-downtime, reversible schema migrations in PostgreSQL.
pgroll is an open-source command-line tool that enables safe and reversible schema migrations for PostgreSQL by serving multiple schema versions simultaneously. It ensures client applications continue working during database updates by applying changes without locking and allowing both old and new schemas to operate concurrently, even with breaking changes. This approach eliminates migration risks and simplifies application rollouts with instant rollback capabilities.
Database administrators and backend developers managing PostgreSQL databases who need to perform schema migrations without downtime or risk of breaking existing applications. It is particularly valuable for teams running production services that require continuous availability.
Developers choose pgroll over traditional migration tools because it guarantees zero-downtime migrations and instant rollbacks by maintaining simultaneous schema versions using PostgreSQL views. Its unique selling point is the ability to handle breaking changes safely without locking the database, working with existing schemas and automatically backfilling columns as needed.
PostgreSQL zero-downtime migrations made easy
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Applies schema changes without database locking or breaking existing client connections, as highlighted in the README's key features for production safety.
Keeps old and new schema versions working in parallel during migration, enabling safe rollout of breaking changes using PostgreSQL views.
Handles column backfilling automatically when required by schema changes, reducing manual scripting and errors.
Allows immediate reversion to the previous schema version if issues arise, enhancing migration safety without complex recovery steps.
Works with already established database schemas without requiring a fresh start, as stated in the features for easy adoption.
Benchmarks in the README show write amplification with triggers, slowing down write operations during active migrations due to added complexity.
Requires initializing the database with pgroll's internal state table via 'pgroll init', adding an extra step compared to simpler migration tools.
Only supports PostgreSQL 14.0+ and compatible services, making it unsuitable for projects using other database systems.
Uses JSON for migration definitions, which can be less flexible and harder to debug than code-based approaches used in some ORMs or frameworks.