News for hackers. Stuff that matters.
Re:Why Databases Are Not for Docker Containers by XorNot on Monday February 06, 2017 @03:55PM (#13583810)
This article is terrible. It's a lot of wishy-washy explanations devoid of technical detail - because their isn't a technical explanation or justification for this list.

I've run extensive benchmarks of Hadoop/HBase in Docker containers, and there is no performance difference. There is no stability difference (oh a node might crash? Welcome to thing which happens every day across a 300 machine cluster).

Any clustered database setup should recover from failed nodes. Any regular relational database should be pretty close to automated failover with replicated backups and an alert email. Containerization doesn't make this better or worse, but it helps a lot with testing and deployment.

Re:Why Databases Are Not for Docker Containers by wkd on Monday February 06, 2017 @05:26PM (#13584866)
While I agree with you I'd like to caution some users about rushing into dockerising everything in their production environment. If your environment setup is not repeatable and you don't have your configuration management under control then you have other problems and using docker is just going to add another layer of abstraction on your mess that your DBA doesn't know how to deal with when things hit the fan. In particular I can imagine improper understanding of docker volumes could bite some people, but they also have some questionable defaults for networking (user land proxy, rewriting iptables)

That being said we currently use docker for some of our production databases, mainly for almost-idle services (mongodb for graylog, zookeeper for kafka), but I have had no problem using them for some moderately sized services with a couple thousands writes per second on redis/kafka (which is nothing for them).

We're still using non-containerised versions of the databases that needs dedicated bare metal servers mostly because I don't see the risk-benefit being worth it, but I'd love to hear someones war stories about running larger scale databases in docker.

For development, I don't think there's anything better for databases, it beats manual setup, vagrant boxes, and shared development servers by a long shot. I feel that educating everyone on your team in how to use it is well worth the investment. docker-compose makes setting up even a fairly complicated development environment a breeze.

Re:Why Databases Are Not for Docker Containers by alexnewman on Monday February 06, 2017 @05:01PM (#13584630)
Yeah volumes skip unionfs. This article is full of FUD. The author demonstrates they don't really have enough experience to make these claims. I wonder if google has database nodes in containers? Kubernetes is adding the features for containers now. I think it is stable now.
Re:Why Databases Are Not for Docker Containers by jdc0589 on Monday February 06, 2017 @05:08PM (#13584707)
> I wonder if google has database nodes in containers?

I've been wondering this for a while. I'm sure some of the big players do it, but I'd really like to see a case study from one of them.

Re:Why Databases Are Not for Docker Containers by derekperkins on Tuesday February 07, 2017 @11:16AM (#13590338)
YouTube runs MySQL on Borg too, and they open sourced their management solution. - http://vitess.io
Re:Why Databases Are Not for Docker Containers by mondoshawan on Monday February 06, 2017 @08:48PM (#13586245)
Google runs MySQL on Borg internally.
Re:Why Databases Are Not for Docker Containers by puzzle on Tuesday February 07, 2017 @02:26AM (#13587764)
Same for Bigtable and Spanner.
Re:Why Databases Are Not for Docker Containers by ldoguin on Thursday February 09, 2017 @06:04AM (#13606065)
I assume these guys have their own network controller and kickass optic fiber links. Network attached storage in poor cloud environments leads to issues.
Re:Why Databases Are Not for Docker Containers by binocarlos on Tuesday February 07, 2017 @05:27AM (#13588421)
Yes stateful sets became beta in k8s 1.5 - it's very much a win to run your test suite against a recent (within seconds) production database container that was spun up by CI. Yes you can do this with VMs but that would take 30 seconds :-)
Re:Why Databases Are Not for Docker Containers by tazjin on Monday February 06, 2017 @05:35PM (#13584937)
> I wonder if google has database nodes in containers?

Yes

Re:Why Databases Are Not for Docker Containers by xchaotic on Monday February 06, 2017 @06:03PM (#13585159)
Kubernetes
Re:Why Databases Are Not for Docker Containers by manojlds on Tuesday February 07, 2017 @02:35AM (#13587791)
Google doesn't use Kubernetes internally (except for their google cloud hosted Kubernetes offering - GKE)
Re:Why Databases Are Not for Docker Containers by electrum on Monday February 06, 2017 @07:05PM (#13585657)
Amazon has fully managed database containers: https://aws.amazon.com/rds/
Re:Why Databases Are Not for Docker Containers by kondro on Monday February 06, 2017 @08:51PM (#13586265)
They aren't containers, these are VMs.
Re:Why Databases Are Not for Docker Containers by bhntr3 on Monday February 06, 2017 @05:24PM (#13584850)
Hadoop and HBase are very different from mysql. Those run on yarn and are designed for containers.

> Any regular relational database should be pretty close to automated failover

In my experience, most people who work with mysql would not enable automated failover. And I believe the concerns in the article are valid and important if considering a container for mysql.

Edit: Though I do think it conflates containers and things like kubernetes or mesos in an awkward way. The good arguments are more about running relational dbs in containers on some sort of cluster orchestration system.

Re:Why Databases Are Not for Docker Containers by state_less on Monday February 06, 2017 @05:09PM (#13584719)
I've run Oracle in a container, ugh what a pig, though it can be done. It's great for development, since you can checkpoint state, pass it around and have 99 containers of bugs on the ground.

At the end of the day, the data and database is run on some production instance that runs on a fully bare hypervisor at TopGuy (TM) cloud provider. This is enough so that everyone feels more or less good about their situation.

Re:Why Databases Are Not for Docker Containers by brianwawok on Monday February 06, 2017 @06:36PM (#13585418)
> I've run Oracle in a container

Danger, danger

https://www.theregister.co.uk/2016/02/24/oracle_vmware_licen...

Re:Why Databases Are Not for Docker Containers by yellowapple on Tuesday February 07, 2017 @07:32AM (#13588905)
For me, alarm bells were already ringing at "I've run Oracle" ;)
Re:Why Databases Are Not for Docker Containers by state_less on Monday February 06, 2017 @08:29PM (#13586142)
Re:Why Databases Are Not for Docker Containers by brazzledazzle on Tuesday February 07, 2017 @07:49AM (#13588979)
I'm going to have to agree with the other reply. One hand doesn't know what the other is doing and the team that does audits to prop up revenue isn't going to care about that blog post unless it has legal language in the license that allows you to bypass licensing restrictions. That said, there's free versions of Oracle's databases for development and they may have exceptions for development purposes so if that's what someone is using containers for it might not be the end of the world.
Re:Why Databases Are Not for Docker Containers by state_less on Tuesday February 07, 2017 @01:47PM (#13591540)
Yep, licensed Oracle instance for production and docker for developers. If you're the sort to run Oracle, the expectation is that you're going to be paying.
Re:Why Databases Are Not for Docker Containers by brianwawok on Monday February 06, 2017 @09:17PM (#13586390)
Just because they write a blog on something does not mean they won't sue you for using it (and then offer to drop the suite if you subscribe to buying a cloud license)
Re:Why Databases Are Not for Docker Containers by guardiangod on Monday February 06, 2017 @04:17PM (#13584096)
Are you telling me that you'd trust MySQL auto replication failover enough to have it activates multiple times per day (even with Percona)? On a busy cluster with, say, 300GB?
Re:Why Databases Are Not for Docker Containers by subway on Monday February 06, 2017 @04:54PM (#13584550)
Seems like a straw-man. Why is a process running within a container failing over more frequently than a process running directly on bare metal -- seems like more of a resource/process scheduling issue than anything to do with containers.
Re:Why Databases Are Not for Docker Containers by guardiangod on Monday February 06, 2017 @05:28PM (#13584878)
Leaving aside there's now yet another abstraction layer to have bugs, it is not a straw-man to imply that current container technology is not as reliable as bare metal.

Or do you mean that Docker etc. are as reliable as bare metal?

Heck, you can go on Docker's webpage (https://www.docker.com/what-docker). Notice that while they make the claims that Docker is-

1. More lightweight

2. 'Open'/run anywhere

3. Secure

They don't say 'more reliable'.

I use Docker for systems I design; I also recognize current container technologies have their limitations. It is my job to know and avoid these pitfalls.

Re:Why Databases Are Not for Docker Containers by tazjin on Monday February 06, 2017 @05:34PM (#13584933)
This conversation should distinguish between Docker as a product and container technology in general.

A lot of issues that people encounter with Docker specifically disappear if you run Kubernetes (such as volume management), simply by ignoring what Docker does and doing something sane instead.

> Or do you mean that Docker etc. are as reliable as bare metal?

This doesn't really mean anything, Docker the product has a lot issues - sure. Container technology in general? No. Where do you draw the line here? Is a chroot 'as reliable as bare metal'? At what point is a container not running on bare metal anymore?

Re:Why Databases Are Not for Docker Containers by guardiangod on Monday February 06, 2017 @05:56PM (#13585118)
Of course Namespace in Linux kernel is very mature. But if that's all people use, then there wouldn't be a need for Docker and its extra features- people would still be using LXC (no disrespect to LXC). People have to evaluate the entire software as a whole, instead of just looking at the core technology. I personally feel that Docker is still unproven in terms of maturity. Stateless? Hell yes. Stateful app? Well...

As you said, a lot of problems would disappear if people use Kubernetes instead of Docker. At the same time, a lot of replication problems would disappear if people use PostgreSQL instead of MySQL. My point is, when a novice mixes immature technology with immature technology, he is going to have more issues than what's necessary.

Re:Why Databases Are Not for Docker Containers by subway on Monday February 06, 2017 @05:44PM (#13585018)
At no time was the claim made that containers were more reliable than any other method of running a process, only that running a process within a container is not inherently less reliable than un-contained.

Unless you've gone out of your way, Docker (as well as other Linux container systems) are just namespacing your process. There's no extra abstraction layer, it's just a more restricted execution environment.

Re:Why Databases Are Not for Docker Containers by throwawayish on Monday February 06, 2017 @07:35PM (#13585831)
The numerous performance and stability issues (not just in the containers, but also affecting the main cgroup / "host" rather badly) I had with Docker, but never with LXC, which, according to you would be pretty much the same thing - "just namespacing your process". But it isn't.

Docker is ok when it works, hell when it doesn't, has lots of bugs and regularly regresses. I don't understand why you'd run production infrastructure on that and not on any of the alternatives.

Re:Why Databases Are Not for Docker Containers by user5994461 on Monday February 06, 2017 @07:07PM (#13585670)
FYI: The networks and the disks are entirely abstracted, with multiple extremely complex abstraction layers.
Re:Why Databases Are Not for Docker Containers by brobinson on Monday February 06, 2017 @09:28PM (#13586451)
Not necessarily. You could use --net=host and -v /db_data:/db_data (equivalent of `sudo mount --bind /db_data /the/containers/root/fs/dir/db_data`)

Run like this, there is no disk or network performance difference between running the db process directly on the host or via a Docker container.

As others have mentioned, this is a really poor article.

Re:Why Databases Are Not for Docker Containers by gnufied on Monday February 06, 2017 @09:25PM (#13586437)
Volume mounts inside containers bypass unionfs. There isn't anything inherently different about using a partition from container or from a host.
Re:Why Databases Are Not for Docker Containers by user5994461 on Monday February 06, 2017 @07:11PM (#13585702)
> Why is a process running within a container failing over more frequently than a process running directly on bare metal

Because the way to change anything in a container is to kill it and restart it. That's a fundamental difference compared to managing/maintaining a database not in a container.

Re:Why Databases Are Not for Docker Containers by subway on Monday February 06, 2017 @07:38PM (#13585849)
Unless you've written very poorly behaving software, you kill it by sending it a SIGTERM, and waiting for it to exit. This is true of software both within and outside of containers.

The fact `docker kill` defaults to using SIGKILL instead of SIGTERM is unfortunate, and something one should be aware of before deploying a process with docker, but again, this does not make the process running within the container inherently less reliable.

edit: Looks like `docker stop` does the right-ish thing -- sends a SIGTERM, then only resorts to SIGKILL after a timeout has expired.

Re:Why Databases Are Not for Docker Containers by brazzledazzle on Tuesday February 07, 2017 @07:55AM (#13589016)
Also worth noting that the timeout is a configurable parameter with `docker stop`.
Re:Why Databases Are Not for Docker Containers by ec109685 on Monday February 06, 2017 @10:42PM (#13586807)
You don't have operate your container like that. If you need to push configuration to it, you can make it writeable.
Re:Why Databases Are Not for Docker Containers by eicnix on Monday February 06, 2017 @04:00PM (#13583862)
Hi XorNot,

did you publish your findings anywhere?

Re:Why Databases Are Not for Docker Containers by XorNot on Monday February 06, 2017 @04:29PM (#13584256)
Sadly no (and I'd have to clear it with my employer). We're going to be doing some much larger scale testing in the next few months (going from 4-5 nodes to 18) in preparation for the docker rollout on said cluster.
Re:Why Databases Are Not for Docker Containers by markbnj on Monday February 06, 2017 @10:58PM (#13586894)
Exactly, and thank you.