pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRisks of running Postgres as a Docker container?
7+ messages / 6 participants
[nested] [flat]
* Risks of running Postgres as a Docker container?
@ 2017-09-25 05:08 Gustav Karlsson <gustav.karlsson@bekk.no>
2017-09-25 05:13 ` Re: Risks of running Postgres as a Docker container? robert <robert@redcor.ch>
2017-09-25 10:17 ` Re: Risks of running Postgres as a Docker container? Vladimir Rusinov <vrusinov@google.com>
2017-09-25 10:56 ` Re: Risks of running Postgres as a Docker container? scott ribe <scott_ribe@elevated-dev.com>
2017-09-25 11:37 ` Re: Risks of running Postgres as a Docker container? Manuel Gómez <targen@gmail.com>
2017-09-25 13:43 ` Re: Risks of running Postgres as a Docker container? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 5 replies; 7+ messages in thread
From: Gustav Karlsson @ 2017-09-25 05:08 UTC (permalink / raw)
To: pgsql-admin; +Cc: Gustav Karlsson <gustav.karlsson@bekk.no>
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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
@ 2017-09-25 05:13 ` robert <robert@redcor.ch>
4 siblings, 0 replies; 7+ messages in thread
From: robert @ 2017-09-25 05:13 UTC (permalink / raw)
To: pgsql-admin
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
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
@ 2017-09-25 10:17 ` Vladimir Rusinov <vrusinov@google.com>
4 siblings, 0 replies; 7+ messages in thread
From: Vladimir Rusinov @ 2017-09-25 10:17 UTC (permalink / raw)
To: Gustav Karlsson <gustav.karlsson@bekk.no>; +Cc: pgsql-admin
On Mon, Sep 25, 2017 at 6:08 AM, Gustav Karlsson <gustav.karlsson@bekk.no>
wrote:
> - Anybody running production databases in Docker? Have you experienced
> many issues?
>
Yes, and yes. :)
> - What are the risks of doing it? (We would of course mount an external
> volume for the data-directory)
>
>
We have not seen any durability issues due to docker. We have seen some
docker bugs where individual containers or the whole docker daemon will get
stuck in weird states, but it seems to have gotten better in recent
releases. If you have less than a hundred instances you are unlikely to see
these.
--
Vladimir Rusinov
PostgreSQL SRE, Google Ireland
Google Ireland Ltd.,Gordon House, Barrow Street, Dublin 4, Ireland
Registered in Dublin, Ireland
Registration Number: 368047
Attachments:
smime.p7s (application/pkcs7-signature, 4.7K) download
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
@ 2017-09-25 10:56 ` scott ribe <scott_ribe@elevated-dev.com>
4 siblings, 0 replies; 7+ messages in thread
From: scott ribe @ 2017-09-25 10:56 UTC (permalink / raw)
To: Gustav Karlsson <gustav.karlsson@bekk.no>; pgsql-admin
On Sep 24, 2017, at 11:08 PM, Gustav Karlsson <gustav.karlsson@bekk.no> 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
@ 2017-09-25 11:37 ` Manuel Gómez <targen@gmail.com>
2017-09-25 13:40 ` Re: Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
4 siblings, 1 reply; 7+ messages in thread
From: Manuel Gómez @ 2017-09-25 11:37 UTC (permalink / raw)
To: Gustav Karlsson <gustav.karlsson@bekk.no>; pgsql-admin
On Mon, Sep 25, 2017 at 7:09 AM Gustav Karlsson <gustav.karlsson@bekk.no>
wrote:
> - 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)
>
Rather than particular risks, there is some work you may have to do to
enjoy all the benefits of deploying Postgres in Docker, specifically
regarding deploying images with the appropriate configuration for automated
backups and automated/assisted distributed cluster management, which you
generally want for production.
There's a lot of experience with these problems collected in some
open-source projects, though! You may be interested in Spilo
https://github.com/zalando/spilo and Patroni
https://github.com/zalando/patroni — and keep an eye out for
Kubernetes-native support currently being tested in Patroni:
https://github.com/zalando/patroni/pull/500
Note there are some relevant talk videos listed here:
https://github.com/zalando/patroni#how-patroni-works
(Full disclosure: I work in the team that develops and provides support for
internal use of these projects at Zalando.)
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
2017-09-25 11:37 ` Re: Risks of running Postgres as a Docker container? Manuel Gómez <targen@gmail.com>
@ 2017-09-25 13:40 ` Gustav Karlsson <gustav.karlsson@bekk.no>
0 siblings, 0 replies; 7+ messages in thread
From: Gustav Karlsson @ 2017-09-25 13:40 UTC (permalink / raw)
To: Manuel Gómez <targen@gmail.com>; pgsql-admin
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
________________________________
Fra: Manuel Gómez <targen@gmail.com>
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?
On Mon, Sep 25, 2017 at 7:09 AM Gustav Karlsson <gustav.karlsson@bekk.no<mailto:gustav.karlsson@bekk.no>> wrote:
- 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)
Rather than particular risks, there is some work you may have to do to enjoy all the benefits of deploying Postgres in Docker, specifically regarding deploying images with the appropriate configuration for automated backups and automated/assisted distributed cluster management, which you generally want for production.
There's a lot of experience with these problems collected in some open-source projects, though! You may be interested in Spilo https://github.com/zalando/spilo and Patroni https://github.com/zalando/patroni — and keep an eye out for Kubernetes-native support currently being tested in Patroni: https://github.com/zalando/patroni/pull/500
Note there are some relevant talk videos listed here: https://github.com/zalando/patroni#how-patroni-works
(Full disclosure: I work in the team that develops and provides support for internal use of these projects at Zalando.)
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Risks of running Postgres as a Docker container?
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
@ 2017-09-25 13:43 ` Tom Lane <tgl@sss.pgh.pa.us>
4 siblings, 0 replies; 7+ messages in thread
From: Tom Lane @ 2017-09-25 13:43 UTC (permalink / raw)
To: Gustav Karlsson <gustav.karlsson@bekk.no>; +Cc: pgsql-admin
Gustav Karlsson <gustav.karlsson@bekk.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
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2017-09-25 13:43 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-25 05:08 Risks of running Postgres as a Docker container? Gustav Karlsson <gustav.karlsson@bekk.no>
2017-09-25 05:13 ` robert <robert@redcor.ch>
2017-09-25 10:17 ` Vladimir Rusinov <vrusinov@google.com>
2017-09-25 10:56 ` scott ribe <scott_ribe@elevated-dev.com>
2017-09-25 11:37 ` Manuel Gómez <targen@gmail.com>
2017-09-25 13:40 ` Gustav Karlsson <gustav.karlsson@bekk.no>
2017-09-25 13:43 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox