Before we dive into this unknown territory of asynchronous programming, let's first try to recall why we used threads or multiple processes.
One of the main reasons to use threads or multiple processes was to increase the concurrency and, as a result, the ability of the application to handle a higher number of concurrent requests. But this came at a cost of increased resource utilization, and the limited ability to run multiple threads or the launching of heavier processes to accommodate higher concurrency with complex mechanisms of implementing locks between the shared data structures.
Now, in the context of building a scalable web application, we also have a few major differences from a general purpose compute-heavy application. In the functioning of the web application, most of the time, the application is waiting on the I/O so as...