← All Research Papers
Cloud & DevOps

Zero-Downtime Database Migrations: The Expand-and-Contract Architecture with CDC

Published: April 02, 2026 • 9 min read • Y By Yash
A technical walkthrough of executing schema alterations, table re-indexing, and major database engine upgrades in high-throughput production environments.

Table of Contents

1. The Failure of Traditional Maintenance Window Migrations

In global 24/7 digital businesses, scheduled maintenance downtime windows are completely unacceptable. A table lock lasting even five seconds can cause upstream connection queues to back up, triggering cascading microservice timeout errors.

Executing seamless zero-downtime schema evolution requires strict adherence to the 'Expand and Contract' (also known as Parallel Run) engineering pattern.

Frequently Asked Questions

Q: What is Change Data Capture (CDC)?
CDC monitors database write-ahead transaction logs (WAL in PostgreSQL or binlog in MySQL) to stream real-time row-level changes into Kafka or destination databases with minimal performance overhead on the primary database.
Q: Why should you never execute an ALTER TABLE with a non-null default directly on high-traffic tables?
In older database engines, adding a column with a non-null default acquires an exclusive table lock and rewrites every single table row on disk, locking out all concurrent user queries.
Y
AUTHOR & FOUNDER

Yash

Software Engineer & Founder, YashLab

Yash is a full-stack software engineer and systems builder. He created YashLab to document real-world architectural blueprints, database scaling strategies, cloud cost optimization, and developer tools.

Focus Areas: Distributed Systems Cloud Architecture Database Scaling Web Performance