Resilience

When we design and develop a system, we have consider all conditions--good and bad. If we consider only the good conditions, then we tend to implement a system that may fail after just a few days. A major application failure results in downtime and data loss and damages your application's reputation in the market.

So, we have to focus on every condition to ensure the responsiveness of the application under all conditions. Such a system or application is known as a resilient system.

Every system must be resilient to ensure responsiveness. If a system is not resilient, it will be unresponsive after a failure. So, a system must be responsive in the face of failure as well. In the whole system, failure can exist in any component of the application or system. So, each component in the system must be isolated from each other so that at the time of failure of a component, we can recover it without compromising the system as a whole. Recovery of an individual component is achieved by replication. If a system is resilient, then it must have replication, containment, isolation, and delegation. Take a look at the following diagram, which illustrates the resilient traits of a reactive application or system:

As you can see in the preceding diagram, resilience is achieved by replication, containment, isolation, and delegation. Let's discuss these points in detail:

  • Replication: This ensures high-availability, where necessary, at the time of component failure.
  • Isolation: This means that the failure of each component must be isolated, which is achieved by decoupling the components as much as possible. Isolation is needed for a system to self-heal. If your system has isolation in place, then you can easily measure the performance of each component, and check the memory and CPU usage. Moreover, the failure of one component won't impact the responsiveness of the overall system or application.
  • Containment: The result of decoupling is containment of the failure. It helps avoid failure in the system as a whole.
  • Delegation: After failure, the recovery of each component is delegated to another component. It is possible only when our system is composable.

Modern applications not only depend on the internal infrastructure but are also integrated with other web services via network protocols. So, our applications must be resilient at their core in order to stay responsive under a variety of real-world in the opposite conditions. Our applications must not only be resilient at the application level but also at the system level.

Let's see another principle of the reactive pattern.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset