Interview Prep/Docker/Resource Limits, Health & Reliability

How should stateful workloads (databases) be run in Docker?

AdvancedProductionResource Limits, Health & Reliability
Answer

Possible (named volumes on fast durable storage, resource limits, backups, tuned shm_size, stop timeout long enough for clean shutdown), but for production we usually prefer managed services (RDS, Cloud SQL) because backups, failover and patching are solved. Containerized DBs are great for dev/CI. If on Kubernetes use operators (CloudNativePG, etc.) and not hand-run volumes.

All Docker questions Roadmap: Docker & containers

More on Resource Limits, Health & Reliability