Communication Models

Communication models

Message queues and event logs can enable two different forms of communication, known as point-to-point and publish-subscribe.

The point-to-point model

The point-to-point model is used when we need to connect only two applications.

Note: Point-to-point refers to the number of applications, not the actual servers. Every application on each side might consist of multiple servers that produce and consume messages concurrently.

The publish-subscribe model

The publish-subscribe model is used when more than one application might be interested in the messages sent by a single application.

For example, suppose a customer made an order might be needed by an application sending recommendations for similar products, an application that sends the associated invoices, and an application that calculates loyalty points for the customer.

Using a publish-subscribe model, the application handling the order can send a message about this order to all the applications that need to know about it, sometimes without even knowing which these applications are.

Get hands-on with 1200+ tech skills courses.