Relational database replication in kubernetes with more than master

4/23/2019

I'm working with a kubernetes cluster to deploy a high available web application, the web application needs a database to store data .

Is it possible to ensure relational database replication (mysql, postgres or oracle) with multiple masters in kubernetes ?

Any helpful comments would be appreciated.

-- Amine Bouzid
kubernetes
mysql
oracle11g
postgresql

2 Answers

4/23/2019

If the engine can do multi-master outside of kubernetes, it can do inside. However, I would suggest to not reinvent the wheel and use existing operators (see what operator pattern is) for databases you mentioned:

  1. Overview for mysql: https://banzaicloud.com/blog/mysql-on-kubernetes/
  2. Postgres: https://github.com/zalando/postgres-operator
  3. Postgres: https://github.com/CrunchyData/postgres-operator

In particular, https://github.com/oracle/mysql-operator claimed support of multi-master.

-- Max Lobur
Source: StackOverflow

4/23/2019

AFAIK, most DB does not provide a out of the box solution to run them in a Kubernetes cluster other than the standard master replica approach.

On the other hand, you could use tools like Vitess to manage that for you. Currently it supports only MySql.

Vitess enables you have multiple masters by sharding the data and managing the keyspaces for you, reducing the complexiby of managing it yourself.

-- Diego Mendes
Source: StackOverflow