Dockerizing MySQL at Uber Engineering
This article shows so little understanding of the software they are using that it frankly makes me a bit mad. Based on my experience as a MySQL DBA, I feel I can safely say that this method of running databases does not scale, and Uber will need to do even more engineering here before too long. Of course, that might be mitigated by the extreme amount of data sharding Uber is doing, but their data will only grow, and this approach will quickly start coming apart at the seams.<p>1) MySQL requires one file to configure it: my.cnf. This is not exactly a huge amount of configuration which needs to occur. Installs via puppet, Chef or Ansible tend to consist of two commands - one to install the package, and one to write the my.cnf (templates are good so you can use the same command on any sized server). You can add one more command to set up the initial users, should you so desire.<p>2) Multiple MySQL processes on the same host wastes that host&#x27;s resources. A single MySQL instance is perfectly capable of running multiple databases, and will respond faster because it will properly allocate the boxes memory according to each DB&#x27;s usage. Multiple processes will each chomp up the configured bit of memory, not allowing individual databases to use the resources they need. It&#x27;s always faster to serve data from memory than from disk (even if that disk is an SSD). Worse, under-utilized DB instances will be swapped off to disk, causing even more load and delay as they are swapped back in.<p>3) Transferring data from one host to another when you need to bring up a stateful process does not scale. Above a few gigs, the transfer process creates significant load on both the source and destination host, and will easily saturate the link between the two. Neither will respond to requests with any alacrity, meaning you typically want to take both hosts out of the active DB pool.<p>4) The DB restoration process from copying over the raw files can take 10+ minutes, depending on how many dirty pages existed on the source. The restoration process will go faster with logical dumps, but logical dumps will take longer to generate, transfer, and load.<p>To reiterate, this are problems for those companies running at scale, with terabytes of data and dozens (or more) DB servers. When you&#x27;re running a few GB of data, a DB container is probably going to work fine. Just don&#x27;t believe for a second that you can scale it the same way you do your web frontend services.<p>It pays to hire experts. How much time and money has Uber sunk into working around their DB, instead of with it?