简体   繁体   中英

how nodejs server is different from apache tomcat server(App server)?

When we hit app server(apache tomcat) on ,it creates a thread to process our request and connect with tomcat ,build connection and tomcat creates another thread to process request and deliver it to the connection and connection thread delivers it to client.

But we nodejs has event loop(on task at a time till completion).When request comes to nodejs server ,event loop picks request from listener queue and delegates the task to worker threads that runs on background. now event loop is free to pick other requests,when worker thread has completed the processing it send the data to call back and event loop picks call back from callback queue if there is nothing to else to do in main stack.

I want to clear my doubt regarding app server and node server

App server : thread created by server to connect tomcat is responsible for delivering data to client for that particular request ? Am i right?

But how nodejs knows to which request it needs to deliver response?How it is maintaining the connection for every request? Im my understanding of request processing is right for both kind of servers?

node.js server is where your node program runs where as apache/nginx is just a reverse proxy server. a reverse proxy server is often used with node.js server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM