Message-driven applications

Traditional microservices have an API that immediately returns a result and every participant of a working application has to know about the other parts. This approach keeps the relations of microservices close. Such an application is hard to maintain, update, and scale.

It is much more convenient if your application interacts via messages that are handled by other microservices. This approach is called message-driven, when you use messages as a unit of interaction. Messages help you to reduce the coupling of microservices, because you can process a message for multiple services simultaneously or add an extra processing message for a particular message type.

To have totally uncoupled microservices, you should use a message queue or a message broker service. We will learn this approach in detail in Chapter 12, Scalable Microservices Architecturein which we talk about scalable architecture.