Reactive systems
A reactive system is a definition of a set of principles that are needed to maintain the responsiveness of and build systems that are able to respond to requests even with failures or under heavy load.
To build such a system, a reactive system chooses a message-driven model that is considered reliable and performant. All the components interact with each other using messages that are sent and received asynchronously. To decouple senders and receivers, components send and receive messages using virtual addresses.
But what's a virtual address? It's a destination identifier that's usually expressed as a URL. The delivery semantic depends on the technology used in the reactive programming frameworks to implement them.
In this design, there is no block during the execution of the flow—senders do not wait for a response; they may receive a response later and in the meantime, they can continue to do their job of sending other messages.
So the main core of a reactive system is an asynchronous messaging design that should be able to guarantee the following properties:
- Elasticity: The ability to scale horizontally that comes from the decoupling provided by message interactions. A load balance strategy is used by consumers of the messages, which are sent to a virtual address to distribute the load and guarantee high performance.
- Resilience: The ability to handle failure and to recover messages that comes from the ability to handle failure without blocking the execution of the services workflow. Thanks to the asynchronous aspect, components don't wait for responses and a potential failure of one component would not impact others. Furthermore, when a node that is consuming a message fails in the operation, the message can be processed by another node registered on the same address.
With the possession of these two characteristics, a system could be considered responsive.
This set of principles is very important when you intend to build microservice systems that are distributed and that are beyond the control of the caller.