Regarding how node.js is suitable for clients and web servers, is my description below correct?
- (A) are customers
- (B) node.js running on some kind of web server
- (C) - these are the βservicesβ in which the business logic is located, database access procedures, for example. "GetCustomer ()". For simplicity, suppose service (C) provides a REST interface.
Thus, in the thread, the client (A) will request some resource from node.js (B), which, in turn, will send this request (with all its asynchronous messages and events) to the service (C), which can go and receive some information about the client and return it to node.js (B) via a callback, and then, in turn, node.js returns a response to the client.
1. Is this right?
Two related questions:
2. How does node.js know which service is sending the request? Do you need to create api stubs in node.js that reflect the service APIs as the client does not speak directly with the services?
3. How is session state handled in this architecture?

source
share