Now a days you may hear a term “Reactive Architecture” many places. As a part of this article we will try to understand need of Reactive Architecture ,What is Reactive Architecture and How reactive programming and reactive systems are different.
Why we need “Reactive Architecture” ?
Earlier (few years ago) application requirements were
- Applications were deployed on tens of servers.
- User can wait for few seconds to get response.
- End users are not having problem with hours of offline maintenance.
- Applications should deal with gigabytes of data.
With Modern demand things are changed, now application requirements are
- Applications are deployed on cloud-based clusters running thousands of multi-core processors.
- User can wait for few milliseconds to get response.
- End users want 100% uptime and don’t want hours of offline maintenance.
- Applications should deal with Petabytes of data.
These modern demands are simply not met by earlier software architectures.so we need to have coherent approach to systems architecture.
What is Reactive Architecture?
In order to coherent with modern requirements, we want systems to be Responsive,Resilient, Elastic and Message Driven. We call these systems as Reactive Systems.Primary Goal of Reactive systems is to provide experience that is responsive in all conditions.
Reactive Architecture follows Reactive principles mentioned below
- Responsive – This means system should consistently responds in timely fashion at any time.System should respond fast and consistent which will build user confidence and encourage further interaction.
- Resilient – This means system should be responsive even when failure occurs.This can be achieved through Replication, Isolation, Containment(Stop calling other services when encounter failure), Delegation. Recovery is delegated to external component(e.g. Kubernetes) which will take action(e.g. restart or create new instance ) in case of failures.
- Elastic -This means system should be responsive despite changes(increase/decrease) in system load. System can auto scale up at peak load and it can scale down when load is less.
- Message Driven – This means that system should be built on foundation of async, non-blocking messages which will provide loose-coupling, isolation, location transparency. Also responses will be consumed only while system is active .
How Reactive Programming and Reactive Systems are different ?
Reactive systems : It apply the Reactive Principles at architectural level.Also,They are separated along asynchronous boundaries.
Reactive Programming : It supports construction of Reactive systems. Also It supports breaking problems in small discrete steps.
If you are using reactive programming doesn’t mean that you are building Reactive system.
This is all about introduction to reactive architecture.