The Virtuous Developers Guide to Reactive Programming - www.credera.com
The Reactive Shift
Compared to the traditional approach of multiple threads, which communicate through shared, synchronized state, a reactive application is composed of loosely coupled event handlers. The reactive approach emphasizes scalability that's resilient, fault tolerant, and quick to react to stimuli. The name "reactive" comes from the four common traits of the reactive model:
1. React to events: Events, represented as messages, are sent and received by asynchronous, non-blocking components. These non-blocking components are used in every layer of the application, from the UI request and the web layer, to the middle-tier service components, down to the database.
2. React to changing load: Components should be loosely coupled, location independent, and should communicate via message-passing structures. This makes it much easier to scale up (adding more instances of a component on a multi-core node) and scale out (adding more nodes to a cluster).
3. React to failures: Resiliency must be built into the design from the beginning. Component failure is expected and managed through component isolation. Loosely coupled components, with strongly encapsulated state, are managed by observers/supervisors which prevent cascading failures.
4. React to users: Responsiveness is largely a result of getting the three other traits correct.
To achieve reactive nirvana, RxJava suggests the use of an "observable" model. This simple, powerful abstraction makes it easy to build non-blocking, loosely-coupled, resilient components.
Read full article from The Virtuous Developers Guide to Reactive Programming - www.credera.com
No comments:
Post a Comment