简体   繁体   中英

Nodejs many rest calls in a single threaded env

we would like to create a meteor client web app, we already have a java based business logic server that exposes rest services (stateless).

Our intention was that the server of the meteor app(nodejs) will call the business logic server for many many rest services.

We are fearing the following :

Since there will be many rest calls from the nodejs to the java rest server and since the nodejs is single threaded will the whole architecture fail??

As long as you are not blocking that single thread, node is more than capable of handling as many requests as you are likely to throw at it.

All I/O operations in Node are evented and asynchronous. In essence, keep your own request / response operations asynchronous and you won't hit any problems.

There are a lot of answers / articles on this subject, but you'd do well to start with:

How the single threaded non blocking IO model works in Node.js http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/

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