I have been trying to scale my application recently. Consider my application having 3 services which work fine with a docker-compose file.
As a first step, I was able to scale them across devices using
replica factor. With this, the docker swarm was able to run a few services in a few devices and few other services in a few other devices. These were working fine as intended. In this use-case any replica of
service1 talks to any replica of
sevice2 and any replica of
service2 talks to any replica of
Now I want a modification to this architecture as shown below As you can see, here each replica talks within itself and do not talk with the other replica. In other words
Service1.1 should talk only with
Service2.1 and should not talk with
Service2.4 . How can I make this possible with the help of a docker swarm?