
The architecture is explained using the workflow of a restaurant in the following way:
A few customers waiting for a table are analogous to requests waiting for available threads.
Customers waiting for orders at the table are analogous to requests waiting for responses.
Each bartender is analogous to the Application thread.
The person shopping for grocery is analogous to the database thread.
It functions in the following way:
Step 1: Each thread executes the entirety of the web application open parenthesis just like how each Bartender executes the order starting from purchasing grocery, cooking, or mixing drinks to serving the order close parenthesis.
Step 2: The thread open parenthesis cooking staff close parenthesis is blocked while it performs a lengthy task.
Step 3: The thread is blocked while it waits for the data to be fetched from the database open parenthesis grocery shopping close parenthesis.
Step 4: The thread open parenthesis Bartender who delivers order to the customer close parenthesis is done and the generated response is finally being delivered.