[ADMIN] Risks of running Postgres as a Docker container?
[ADMIN] Risks of running Postgres as a Docker container?
Hi,
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)
Regards,
Gustav Karlsson
Re: [ADMIN] Risks of running Postgres as a Docker container?
for the last 2 years I am running several databases in docker containers.
I am using preconfigured images, have done nothing to change and I am happy with them
robert
On 25.09.2017 07:08, Gustav Karlsson wrote:Hi,
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)
Regards,
Gustav Karlsson
Re: [ADMIN] Risks of running Postgres as a Docker container?
- 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)
Vladimir Rusinov
PostgreSQL SRE, Google Ireland
Google Ireland Ltd.,Gordon House, Barrow Street, Dublin 4, Ireland
Registered in Dublin, Ireland
Registration Number: 368047
Re: [ADMIN] Risks of running Postgres as a Docker container?
On Sep 24, 2017, at 11:08 PM, Gustav Karlsson wrote: > > - Anybody running production databases in Docker? Have you experienced many issues? https://www.compose.com ;-) -- Scott Ribe scott_ribe@elevated-dev.com (303) 722-0567 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin
Re: [ADMIN] Risks of running Postgres as a Docker container?
- 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)
Re: [ADMIN] Risks of running Postgres as a Docker container?
Thank you all for the feedback! It seems my concerns may be a bit out-dated 😊
Manuel, I have been looking quite a bit at Patroni, and will quite possibly be using that in our setup. Thank you for sharing it with the community! (and ofc also a thank you to Compose for Governor)
Regards,
Gustav
Sendt: 25. september 2017 13:37:46
Til: Gustav Karlsson; pgsql-admin@postgresql.org
Emne: Re: [ADMIN] Risks of running Postgres as a Docker container?
- 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)
Re: [ADMIN] Risks of running Postgres as a Docker container?
Gustav Karlsson 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@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin