AFAIK (last I looked into this was ~6ish months ago), scaling databases in docker containers is a hard problem that currently doesn't have a clean solution. Vitess[0] is a solution, but it didn't seem quite ready for production last I looked at it.
Re:Learn Docker by building a Microservice
by Veratyr on Wednesday June 01, 2016 @10:24AM
(#11814548)
From the Vitess overview page: "Vitess has been serving all YouTube database traffic since 2011".
Given that, it seems production ready.
Re:Learn Docker by building a Microservice
by tayo42 on Wednesday June 01, 2016 @11:20AM
(#11815054)
What is there to gain by putting your database in a container? A database probably has its own dedicated server so, your probably not deploying databases often and there's the added complexity of making your data persistent.
Re:Learn Docker by building a Microservice
by mdk754 on Wednesday June 01, 2016 @12:53PM
(#11816002)
Your point stands, and obviously makes more sense.
My curiosity was more in whether there were performance (or other) bottlenecks which made it technically infeasible.
Re:Learn Docker by building a Microservice
by imaginology on Wednesday June 01, 2016 @01:11PM
(#11816155)
I run my production database in a container, even if it has its own dedicated server. It's nice being able to install, start and initialize the database with a simple docker command or two to get a consistent build, instead of manually setting it up (copying/editing configuration files, deploying schemas, initializing data, setting permissions, etc.) And it makes upgrading the database very easy. Having this process automated and in source control is great. I also have the awesome ability to bundle cron in my database container to schedule regular backups. Persisting data is as simple as mounting a data volume.
Curious why you wouldn't want to run it in docker in production? Wouldn't running the same container in dev/prod be helpful?