Docker Flow Proxy is a stateful service. However, that did not prevent us from scaling it. Its architecture is made in a way that, even though it is stateful, all instances have the same data. The mechanism to accomplish that has quite a few names. I prefer calling it state replication and synchronization.
When one of the instances receives a new instruction that changes its state, it should find all the other replicas and propagate the change.
The replication flow is usually as follows:
- An instance receives a request that changes its state.
- It finds the addresses of all the other instances of the same service.
- It re-sends the request to all other instances of the same service.
The ability to propagate changes is not enough. When a new instance is created, a stateful service with data replication needs to be capable of requesting a complete state from one of the other instances...