Reactive systems and reactive programming

The term reactive is widely used in the definition of MSAs.

But what is a reactive architecture based on? The definition of reactive is to give an answer after a stimulus. Reactive software is, therefore, able to adapt its behavior and react to receive stimuli.

To build a reactive architecture for microservices, the following models must be combined:

  • Reactive programming: A development model based on the observation of streams of data, which provides a way to react to their changes and propagate them toward other actors
  • Reactive system: An architectural model that is used to build robust and highly reactive distributed systems based on asynchronous communication using messages

The definition of a reactive system was formalized, in version 2.0, in September 2014 through the reactive manifesto (https://www.reactivemanifesto.org/). The key concepts of the reactive system are as follows:

  • Responsive: The system must respond in a timely manner.
  • Resilient: The system must remain reactive and functional even in case of failure of some of its components.
  • Elastic: The system must remain reactive uniformly, regardless of the workload to which it is subjected.
  • Message-driven: The reactive systems must communicate with each other through asynchronous messages to favor their decoupling and isolation.

We can, therefore, think of a reactive system as an architectural design to build distributed systems, whereas reactive programming is the implementation of the principles defined in the reactive system that must adhere to the reactive manifesto.