The Problem with Point to Point Communication

Point-to-point communication between servers usually works just fine when one or two instances are communicating.

One or two instances communicating

However, if you increase the number of applications, the total number of connections increases.

Three instances communicating

In fact, the total number of connections increases as a square of the number of application instances. So, if you are running 100 instances, you will be maintaining O(100^2) connections. The scaling becomes quite painful.

What can you do? This depends on your application but one strategy you may want to employ is using a message queue as an intermediary between systems. In this model, an application sends a single message to the message queue, and any interested listeners can read that message as they are able.

Message queue

This design reduces the total number of messages sent, and provides de-coupling of each individual application, further increasing scalability.

Like this post? Subscribe via RSS or email to never miss an update.