From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Gustav Karlsson <gustav(dot)karlsson(at)bekk(dot)no> |
Cc: | "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Risks of running Postgres as a Docker container? |
Date: | 2017-09-25 13:43:46 |
Message-ID: | 17550.1506347026@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Gustav Karlsson <gustav(dot)karlsson(at)bekk(dot)no> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Garry Chen | 2017-09-25 14:58:35 | Foreign data wrappers for Oracle from Postgresql in RDS environment |
Previous Message | Gustav Karlsson | 2017-09-25 13:40:35 | Re: Risks of running Postgres as a Docker container? |