Hacker News new | past | comments | ask | show | jobs | submit login

We spent hours figuring out a good way to use a databases in both dev and production with docker. It was tricky since docker containers don’t support persistence unless you use a mount-point. There were a few patterns documented which didn’t work for us or we didn’t really like. We had to figure it out by ourselves. This is another area where you’re expected to figure out by yourself whether it is a good idea to use docker to run your production database. Hint- Its not.

I think that a problem that leads to a lot of these articles being written is that the motivation of the authors to use Docker is unclear.

Why bother to put your database inside a container if the way you ran your databases before worked just fine?

You shouldn't just rush to put all your processes in containers because it is cool and Containerization Is A Good Thing. You should use technology that makes sense given the problems you are trying to solve at a give moment.




>> Why bother to put your database inside a container if the way you ran your databases before worked just fine?

For the same reason you'd bother putting anything in a container at all. The purpose of docker -as advertised by docker- is to containerize EVERY service. Unless you can point me to a single mention in official documentation that databases are an exception. Till date, I haven't found any and thus this blog.


Completely agree. I don't know where or how people started thinking that putting a stateful service inside of a stateless container was a best practice, but no one should be doing that in production.


I wouldn't contemplate it, except that I'm looking at migrating a Rails/Postgrep app to GKE, and containerizing PG seems like the lowest-friction path. Are there better alternatives for getting to GKE, or is GKE a bad fit for this scenario?


As I said, if it is really as obvious as you say it is, please point me to a single mention in official documentation that databases should not be containerized.


Why would documentation about docker include basic fundamental knowledge about deploying services in production? This isn't docker knowledge, this is service based architecture 101. Why is it docker's responsibility to teach you general software engineering concepts?


point me to a single mention in the official docs that say EVERY service should be containerized




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: