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
Direct Download
Read full article as PDF:
Price $2.95
News
-
Mozilla VPN Now Available for Linux
The promised subscription-based VPN service from Mozilla is now available for the Linux platform.
-
Wayland and New App Menu Coming to KDE
The 2021 roadmap for the KDE desktop environment includes some exciting features and improvements.
-
Deepin 20.1 has Arrived
Debian-based Deepin 20.1 has been released with some interesting new features.
-
CloudLinux Commits Over 1 Million Dollars to CentOS Replacement
An open source, drop-in replacement for CentOS is on its way.
-
Linux Mint 20.1 Beta has Been Released
The first beta of Linux Mint, Ulyssa, is now available for downloading.
-
Manjaro Linux 20.2 has Been Unleashed
The latest iteration of Manjaro Linux has been released with a few interesting new features.
-
Patreon Project Looks to Bring Linux to Apple Silicon
Developer Hector Martin has created a patreon page to fund his work on developing a port of Linux for Apple Silicon Macs.
-
A New Chrome OS-Like Ubuntu Remix is Now Available
Ubuntu Web looks to be your Chrome OS alternative.
-
System76 Refreshes the Galago Pro Laptop
Linux hardware maker has revamped one of their most popular laptops.
-
Dell Will Soon Enable Privacy Controls for Linux Hardware
Dell makes it possible for Linux users to disable webcams and microphones.