简体   繁体   中英

database docker container design

I am working on docker container on linux machine. I have to create database docker container. I have chosen MySQL database. I have three requirement:

  1. load balancing - the database contain a huge table will approx. 100 million record. So we need to share the table across multiple server. To carter this I have chosen MySQL Cluster. I need to distribute the data based on the sharde key. The load balancing will be done by HAProxy.

Que : please correct me if I am wrong? provide a better solution

  1. Persistence - even if the all database container dies, its should able to recover from it For this I have planned to create data-only docker container.

Que : if the data-only docker container dies, will this container able to recover? Is there any change in volume if it comes up?

  1. Availability - Since there will be multiple SQL server with replica feature, even if one server dies other server will become primary.

Que : please correct me if I am wrong? provide a better solution

Once upon a time, I remember a when a database table with one million records was considered "big data"...

在此处输入图片说明

Before assuming you need to split your dataset across multiple machines I would highly suggest that you first get comfortable with running a single database within a Docker container. Given enough resources MySQL is quite capable of scaling up to 100 million records.

Docker is designed to isolate processes from others running on the same host. This creates challenges for monolithic applications which frequently have a software architecture involving multiple processes communicating to each other over some form of host based IPC (inter process communication). That does not mean they cannot be containerized, but a large multiprocess container looks and operates a lot like a virtual machine, implying that perhaps docker is a less optimal technological fit.

Before I get too negative, it's completely possible to run clustered MySQL using Docker. Couple of examples returned by Google:

My warning is that you see less examples of running these clusters across multiple Docker hosts, implying the use cases are mostly for demo or test currently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM