What is Reactive Programming?

Reactive programming used  to improve user’s programming experience. Everyone wants to make their application more responsive. In nutshell we want to deliver effortless user experience our users without freezing the main thread, slowing them down and we do not want to serve the log-grade performance to our users.

To maintain the main thread free, we want to do a lot of heavy and time consuming work we want to do in the backend. We also want to do heavy work and complicated calculations on our server as mobile devices are not powerful to do the heavy pickup. So we need asynchronous work for network operation.

A reactive system is characterized by four properties:

  • Responsive: A reactive system needs to handle requests in a reasonable time (I let you define reasonable).
  • Resilient: A reactive system must stay responsive in the face of failures (crash, timeout, 500 errors. ), so it must be designed for failures and deal with them correctly.
  • Elastic: A reactive system must stay responsive under various loads. Consequently, it must scale up and down, and be able to handle the load with minimal resources.
  • Message driven: Components from a reactive system interacts using asynchronous message passing.