Re:When Node.js is the wrong tool for the job
by brlewis on Friday January 06, 2017 @11:09AM
(#13337387)
"With lots of service calls" describes problems for which async is generally the most performant solution.
[ Parent
| on HN ]
Re:When Node.js is the wrong tool for the job
by utnick on Friday January 06, 2017 @11:26AM
(#13337553)
It could be, but if the service calls generally depend on the response from the previous service call. Or if you need to rate limit your calls to these services, I think its easier to code it not async
Re:When Node.js is the wrong tool for the job
by brlewis on Friday January 06, 2017 @02:54PM
(#13339615)
For batches of transactions where each transaction has a service call that depends on the response from a previous service call, async especially outperforms.
Rate limiting is not hard either way, but single-threaded async is slightly easier because your counter is automatically thread safe.
The larger and more complex your system gets the harder it gets to keep it thread-safe. For me this is the big advantage of single-threaded async, and I like node because this single-threaded async is idiomatic in JavaScript.