Company
Date Published
Author
Rob Reid
Word count
1656
Language
English
Hacker News points
None

Summary

Schema changes in databases, essential as applications evolve, can often cause downtime; however, CockroachDB's approach to online schema changes mitigates this risk by utilizing Multi-Version Concurrency Control (MVCC). MVCC enables databases to handle schema changes in the background without locking tables, allowing applications to remain operational during the process. This is accomplished by creating concurrent versions of data, which supports time-travel queries, letting users view data at previous states without disrupting current operations. The article contrasts CockroachDB's method with traditional stop-the-world schema changes used in databases like Postgres, highlighting that while Postgres experiences significant downtime during schema alterations, CockroachDB maintains low latency and continuous availability, even as tables grow. Furthermore, CockroachDB offers the flexibility to pause, resume, or cancel schema change operations, providing a robust solution for managing schema evolution without sacrificing database uptime.