Understanding Reactive Streams
Normal Java code achieves asynchronicity by using thread pools. Your web server uses a thread pool to serve requests – it assigns a thread to each incoming request. The application uses the thread pool for database connections too. Each database call uses a separate thread and waits for the result. Therefore, each web request and database call uses its own thread. However, there is a wait associated with this and, therefore, these are blocking calls. The thread waits and utilizes the resources until a response is received back from the database or a response object is written. This is kind of a limitation when you scale as you can only use the resources available to the JVM. You overcome this limitation by using a load balancer with other instances of the service, which is a type of horizontal scaling.
In the last decade, there has been a rise in client-server architecture. Lots of IoT-enabled devices, smartphones that have native apps, first...