Gustav Karlsson <gustav.karlsson@xxxxxxx> writes: > At my company we are getting more and more small databases and are considering moving to deploying them as Docker containers for easier management. However, every time I am trying to research the topic of databases as containers, I come across people saying "I would not run a production database in Docker" and similar. Though there do also seem to be plenty of people doing that as well! > So, I was just wondering what the experiences in the community are? > - Anybody running production databases in Docker? Have you experienced many issues? > - What are the risks of doing it? (We would of course mount an external volume for the data-directory) I wouldn't count on an external data directory to save you if the Docker instance crashes. The trouble with any virtualized environment (not just Docker) is that you have an extra layer of I/O abstraction between you and the hardware, which for this purpose means one more place that might break fsync semantics/write ordering guarantees. You'd never notice till you get a hard crash and find your database is corrupted. If it's throwaway data, this doesn't matter of course. If your recovery strategy is mostly depending on streaming standby servers, and not on being able to recover the primary, it might not matter either. But if you need the DB to be crash-safe, you really had better do plug-pull-type testing before trusting a setup like this. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin