GCP Cloud Architecture (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
How does Cloud Spanner handle schema migrations online with zero downtime?
senior LevelgcpAdvanced Internals
In Simple Words: Spanner executes DDL schema updates as long-running, asynchronous background transactions:
- When adding a column or secondary index, Spanner introduces multiple intermediate phases:
ABSENT->WRITE_ONLY->READ_ONLY. - Existing live OLTP transactions continue processing without table locks or read degradation while the index builds across petabytes of historical splits.