While the Reactive Manifesto helps us understand the characteristics of a Reactive System, it does not really help with understanding how Reactive Systems are built. To understand this, we will consider the traditional approach to building a simple use case and compares it with the reactive approach.
The use case we want to build is a stock price page that displays the price of a specific stock. As long as the page remains open, we want to update the latest price of the stock on the page.
The traditional approach uses polling to check whether the stock price has changed. The following sequence diagram shows the traditional approach of building such a use case:
Once the page is rendered, it sends AJAX requests to the stock price service for the latest price at regular intervals. These calls have to be done irrespective of whether the stock price has changed since the web page does not have any knowledge of the stock price change...