Node JS Architecture
- NodeJS Web Server will get request from a client
- In order to provide service to a request, Server maintains a pool.
- Requests are placed in a queue named Event Queue.
- It is a Single Threaded model and used for processing the request.
- Event loop processes the request in the event queue and response is sent to the client.
- In case of any I/O operation like fetching data from DB then it uses different mechanisms to process those requests.
- Here threads are responsible to perform those actions and send them back to event loop.
- And then the event loop will respond to the client.