Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaling mysql in Docker

Tags:

docker

mysql

I'm looking to scale mysql on a swarm that could potentially be involve multiple servers. What is the best way to ensure that the data is in sync between the containers on the different servers?

I realise on a standard configuration without docker I'd have to set up replication. I'm wondering if there is a way to do it which is more suitable and easy to deploy with docker.

like image 200
kevin.coyle Avatar asked Mar 29 '16 10:03

kevin.coyle


2 Answers

Docker-compose and docker swarm are great tool for scaling in docker environments. But Currently MySQL-DB scaling is not possible in docker-compose or docker-swarm. Reasons:

  • Scaling fit for stateless containers

  • Configuration not possible for master-slave in docker-swarm

  • No replication method available in docker overlay network

May be in future we have such tech to enable RDBMS scaling.

like image 82
Manoj Sahu Avatar answered Sep 28 '22 08:09

Manoj Sahu


This is what database replication is for.

https://dev.mysql.com/doc/refman/5.7/en/replication.html

like image 38
Lightness Races in Orbit Avatar answered Sep 28 '22 08:09

Lightness Races in Orbit