Databases
Database operations
Databases hold the one thing you can't redeploy: the data. DevOps and platform engineers are expected to run them safely even without being database administrators: backups that actually restore, replication and failover that apps survive, connection and performance problems, schema changes without downtime, and upgrades. Interviewers probe this with "your database is down", "someone dropped a table" and "how do you upgrade PostgreSQL with no downtime?". This topic focuses on PostgreSQL and MySQL on AWS (RDS and Aurora), with ideas that carry over anywhere.
After this topic you can
- Design backups with point-in-time recovery and prove they restore
- Choose between Multi-AZ, replicas and Aurora and make apps survive failover
- Run schema changes and major upgrades without downtime
Lessons
-
1How databases keep data safe
- What operations owns
- The write-ahead log
- RPO and RTO
-
2Backups and recovery
- Kinds of backup
- Backups on RDS and Aurora
- Restores are the real test
-
3Replication and high availability
- Synchronous and asynchronous replication
- RDS and Aurora options
- Surviving a failover
-
4Performance and capacity
- Connections
- Slow queries and locks
- Storage, vacuum and growth
-
5Changes and upgrades
- Schema migrations without downtime
- Engine upgrades
- Security
-
6Interview questions and model answers
- "Someone ran DELETE without a WHERE clause on production an hour ago. What do you do?"
- "RPO vs RTO?"
- "Multi-AZ vs read replicas?"
- "How does your application survive a database failover?"
- "The app gets 'too many connections' after we scaled from 10 to 50 pods. Why and what do you do?"
- "How do you add a column and an index to a 500 GB table with no downtime?"
- "How would you upgrade PostgreSQL 15 to 17 on RDS with minimal downtime?"
- "How do you know your backups work?"