Reactive Programming and the Reactive Manifesto
Extensions
Event-driven systems are easier to extend: the developer only needs to introduce new events and let the corresponding components respond to them appropriately. According to the manifesto, a reactive application must respond flexibly and scalably to additional loads. If the existing computing power is no longer sufficient, the program must be able to harness more computing nodes, and it must drop them again when the load drops (scale in or out).
If a new computing node with several processor cores or new features are added, the application must be able to leverage these resources (scale up or down). In other words, the application must be capable of adapting to its environment – automatically in an ideal world.
Making your own application elastic seems simple to the manifesto authors: Because the components of the application are only allowed to communicate with each other via events, it would not matter on which compute node a component actually runs (location transparency) – especially if the components are only loosely coupled and run as independently as possible.
The intent is for communication to avoid implementing the known RPC mechanisms. Instead, the authors of the manifesto want to "embrace the network" by representing it directly in the programming model as an asynchronous message exchange.
The authors do not say how exactly this will happen. But, they say, it is important to have the right tools at hand to encapsulate the building blocks for solving typical problems that commonly occur in distributed systems. (Anyone who has ever dealt with distributed systems will probably be raising an eyebrow right now.)
Indestructible
A reactive application must respond to malfunctions and errors. According to the manifest, the application should be able to restore or repair itself, along with the data. For this purpose, the defects or faults must be isolated and parts of the application must be monitored. The manifesto proposes the Bulkhead pattern [10] for this purpose. Like the bulkheads on a cargo vessel separating the parts of the ship, these bulkheads break down the program into individual compartments. The idea is that the failure of one compartment does not take down the others. According to the manifesto, an event-driven model helps with this scenario: If one of the independent components fails, it can easily be restarted or replaced with a clone.
Fast
A reactive application must always respond immediately to a user, regardless of the computational load. A fast response gives users the feeling of solving a task more quickly. According to the manifest, the application should achieve this responsiveness by means of observable models, event streams, and stateful clients.
Observable models, says the manifesto, simply mean using the Observer design pattern: Special components notify other components in case of state changes. For example, if the database updates an address, all clients receive a message about this change. These messages run through special channels, known as event streams. Access to these streams is asynchronous.
Data is simply asynchronously dispatched events. However, the manifest does not address feedback. If a value changes, the application does not recompute all the dependent values. The program only needs to inform the affected components if a value changes.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.