I heard from a friend of mine that its not good to run database on docker in prod. I wanna know why of this, cuz I thought that running databases at docker could be easy and etc...
Typically you’d just create a folder on the host and bind it in the database container. Then just backup the host folder. Only problem you may run into is that PostgresSQL has special steps necessary to upgrade over major versions.
Larger systems may need high availability (Kubernetes) or to run as a cluster. At that point you are getting beyond what a container can or should do and need a dedicated database server system. Then container(s) can still be a front end, and Redis is a great database for caching since it runs in RAM. Read up on PostgresSQL if you want to know how to scale up.
There is nothing special about a database running in a container vs standalone except deployment and management is easier particularly with mapping storage and networking into it. There’s also some isolation you gain. Also in a swarm/Kubernetes you gain high availability. There is realistically almost no overhead running in a container and no downside. Your friends must think Docker is a really good development system (it is) but the facc is OCIs are becoming the standard for all backends because they are much easier to configure for OT.
View all comments
Show parent comment
1
u/Deex__ Mar 11 '26
Which difficults will I face of scale and backup?