Is it recommended to use Database as a container in Production environment? Is it recommended to use Database as a container in Production environment? docker docker

Is it recommended to use Database as a container in Production environment?


We containerise our db in production (on-premises enterprise application). Many do. It's perfectly stable and the deployment is much simplified. Of course our db is not under stress; we're dealing with hundreds of concurrent users, not tens of thousands. We just make sure that the container has enough RAM and is monitored well.

If we did need to dedicate an entire VM to the db alone, then yes I would skip docker.


This blog post lists some reasons why you should not run production databases in containers. It also references another blog post describing problems with updating docker and unstable storage drivers.

The main points here for me boil down to this:

  • Dodgy storage drivers. This may be less of a problem when you write your database state to the host system but Docker for example explicitly encourages users to use volumes for exactly that (see the docs: Citation: "Volumes are the best way to persist data in Docker"). It may just work fine under normal circumstances, but what about the edge-cases like power-failures or read-errors for example?

  • Managing databases in production is hard. Many companies employ full-time DBAs to ensure smooth operation of production databases. The devops paradigm (every dev creates a plethora of DB servers in containers) makes it nearly impossible for a DBA to do his job. That is if the DBA even has access to these DBs.

In conclusion: Containers are fine for certain tasks and a bad idea for others. Running production databases in containers is one of those bad ideas.


According to link below, it is not a good idea to use database container in Production. But as I have experienced; if you isolate your container from your app and update your container regularly and also manage networking stuff, there seems to be no problem.

Link: https://www.quora.com/Is-it-not-advisable-to-use-database-in-Docker-container