A team wants to run PostgreSQL inside Kubernetes instead of RDS. What do you tell them?
IntermediateScenarioData and databases
Answer
Situation read → It's possible and done in production, but it moves backups, failover, upgrades and storage operations onto your team.
What I'd do →
- Ask why: cost, portability across clouds, or needing extensions RDS doesn't support.
- If yes, use a mature operator (CloudNativePG or Crunchy PGO), never a hand-written StatefulSet. It handles replication, failover, backups to S3 and PITR.
- Requirements: dedicated nodes, PDBs, anti-affinity across AZs, gp3 volumes with enough IOPS, and tested restores.
- Compare honestly: RDS costs more per hour but includes patching, Multi-AZ, PITR and support. Count the engineering hours too.
- My default: managed database for core production data, Kubernetes Postgres for dev, preview environments, or where portability is a real requirement.
Why → The database is where mistakes are least reversible, so pay for operations unless there's a strong reason not to.
Interview tip → Give a balanced answer with conditions; "never" and "always" both sound junior.
More on Data and databases
A release needs to rename a column that the running app reads and writes. How do you do it with zero downtime?IntermediateHow do you prove your database backups actually work?IntermediateDesign backups for an RDS PostgreSQL database with RPO of 5 minutes and RTO of 1 hour, including a region failure.AdvancedYour migrations run in an init container and two pods ran them at the same time during a deploy, leaving the schema half-applied. How do you fix the approach?IntermediateUpgrade RDS PostgreSQL from 13 to 17 with minimal downtime. How?AdvancedYou need to add an index and a column to a 500-million-row table that's written to constantly. How do you avoid locking it?Advanced