How can I run multiple SQL Server containers in Azure and make sure data is replicated across them?

5/14/2018

title describes pretty much what we are trying to accomplish in our organization.

We have a very database intensive application, and our single SQL Server machine is struggling.

We are reading articles about Azure, Docker and Kubernetes but we are afraid of trying these technologies.

Our problem is data replication.

How can we have scalability here? If we have three different SQL Server instances in three different containers, How does data get replicated across them? (meaning, user inserts a new product into a shared library, other user accessing a different node/container should be able to see that product).

Maybe we don't need containers at all and Azure provides another way to scale databases?

We really appreciate any help from you guys.

Regards, Cris.

-- kpocrz
azure
azure-sql-database
docker
kubernetes

1 Answer

5/14/2018

I would advise against trying to run your databases on K8s. Kubernetes Containers should generally be stateless application, and were not designed for persistent data storage. Azure provides a Database as a Service, which will be able to scale appropriately with your needs(Azure Pricing for Cloud SQL

We once experimented with running our Postgres DB inside of a Kubernetes pod, but I was terrified to change anything. Not worth it, and not what the system was designed for.

If you are really really committed to this path, you can check out MySQL NDB ClusterMySQL for distributed environments. It should be adaptable to the Kubernetes paradigm.

-- Teddy
Source: StackOverflow