Hacker News new | ask | show | jobs
by jondubois 3567 days ago
Yeah this is tricky. I'm not a huge fan of all these distributed file systems like EBS, NFS or others - That doesn't make much sense for most DBs.

I prefer to have a DB which is "cluster-aware", in this case, you can tag your hosts/Nodes and use Node affinity to scale your DB service so that it matches the number of Nodes which are tagged - Then you can just use the a hostDir directory as your volume (so the data will be stored directly on your tagged hosts/Nodes) - This ensures that dead DB Pods will be respawned on the same hosts (and be able to pickup the hostDir [with all the data for the shard/replica] from the previous Pod which had died).

If your DB engine is cluster-aware, it should be able to reshard itself when you scale up or down.

I don't think it's possible for a DB to not be cluster-aware anyway - Since each DB has a different strategy for scaling up and down.

1 comments

Yes, and for "cluster aware" DBs it is easy to write a small controller that makes it "Kubernetes cluster aware". Here is a demo we did with a WIP etcd controller: https://youtu.be/Pc9NlFEjEOc?list=PL69nYSiGNLP1pkHsbPjzAewvM...