DB Team
The DB team helps you avoid downtimes related to migrations.
The DB team helps you avoid downtimes related to migrations.
Our goal is to provide solutions that enable companies to: avoid downtimes related to databases during releases save engineers’ time spent on preparing and rolling out database migrations enforce best practices to prevent long and risky migrations as your data grows identify and fix root causes of issues experienced during migrations
Why Migrations Can Cause Downtime? One common reason for downtime is the application of bad RDBMS migrations during releases. This issue is related to RDBMS architecture, which needs to know the schema for each query you perform and uses a locking mechanism to ensure only one valid schema is in use. A common scenario is when a migration query locks an actively used table, causing business logic queries such as SELECT, INSERT, UPDATE, and DELETE to wait until the migration is finished.
Locking Mechanism In Postgres, each query involves a locking mechanism to ensure data consistency and integrity. This locking is crucial because it prevents multiple transactions from simultaneously modifying the same data, which could lead to conflicts or corruption. During migrations, DDL (Data Definition Language) queries such as ALTER TABLE can lock tables or rows to make schema changes. Many ALTER TABLE operations require an ACCESS EXCLUSIVE lock, which is the most restrictive lock mode in Postgres.