0

Hello i have the following problem:

I have .NET Core WebApi and a Distributed Database(RethinkDB) that i want to scale using Docker containers. The database can be both sharded and replicated ( i am not interested in replication though). My problem lies in the design:

Using docker i have already created
1. Dockerfile for database
2. Dockerfile for webapi
3. Dockercompose for the pair.

My question is how do you integrate Docker-swarm or Kubernetes for scaling in this situation ? I am not very familiar but the web-api is dependant on the database to work.Do i need docker compose in this situation ? Or how do they all fit together ? (Dockerizing dependent components + scaling ).

Do you dockerize all components in one and then scale it , or you separate them and scale each separately?

Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152

1 Answers1

1

docker-compose is a tool for running multi-container docker applications, but it has limited use. As the docs say, it is commonly used in development environments, automated testing environments and single host deployments. (See: https://docs.docker.com/compose/overview/#common-use-cases)

If you want to deploy such an application on multiple hosts, you will need an orchestration system. Docker-swarm or kubernetes are very good fits. Both systems need a docker registry, where you out your own, custom docker images. These images con be built from your already existing Dockerfiles. Your docker-compose.yaml file is not used on these systems, but you can still use it perfectly for development.

Both solutions can scale each component separately. Which one is actually better is debatable and probably depends on your architecture.

mbuechmann
  • 5,413
  • 5
  • 27
  • 40