Interview › Databases & Caching
How do you migrate a database with near-zero downtime (e.g., using DMS or logical replication)?
Databases & Caching · Intermediate level
Answer
Near-zero downtime migration uses initial load plus ongoing change replication, then a short write drain and controlled cutover. The core tasks are schema prep, CDC, validation, lag monitoring, endpoint switch, and rollback planning.
Technical explanation
WAL/binlog volume affects storage, backup, replica lag, and restore behavior.
Near-zero downtime migration requires initial load, CDC, validation, short write drain, cutover, and rollback planning.
DMS helps move data, but schema conversion, application compatibility, and data validation remain engineering responsibilities.
Hands-on example
Migration runbook:
1. Create target database and schema.
2. Start full-load plus CDC using DMS or logical replication.
3. Monitor lag and task errors.
4. Compare row counts and critical aggregates.
5. Stop writes briefly.
6. Wait for lag to reach zero.
7. Switch endpoint/secret.
8. Monitor app errors and DB load.
9. Keep source read-only until rollback window closes.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- What is AWS DMS, and when would you use it?
- What is WAL (write-ahead logging), and how does it support durability and replication?
- What is schema migration, and how do you run migrations safely in production?
- What is a transaction, and what do the ACID properties mean?
- What is connection exhaustion, and how do you prevent it?
- What is ElastiCache, and what does it manage?
- What is the difference between ElastiCache Redis and Memcached?
- What is Redis, and what core data types does it support?