3 ms·
If you want to load balance this and you need something custom, you're going to be a lot better off starting with Erlang. In Erlang, a PID reference (process ID
by jerf 16y ago
If you want to load balance this and you need something custom, you're going to be a lot better off starting with Erlang. In Erlang, a PID reference (process ID) can transparently be a reference to a process on another machine in the cluster, so sending a message to the target queue is some variant on Message ! Pid regardless of which machine the queue is actually living on. MNesia can be used to keep track of what PID is what and that transparently replicates around without you having to write the logic. In Node.js it's going to be less transparent and unless there's a library that does all this for you, you're still going to be putting the solution together when you could have been done in Erlang, even if you're an expert in JS and know nothing about Erlang.
One of the queuing libraries might just work out of the box, though. But at least at the moment I would actually consider Node.js counterindicated for this task, unless you can be rigidly sure that messages never have to cross process boundaries.
- skeltoac 16y agoAgreed. This sounds like an ideal learning project for Erlang. Open a few tabs of erlang.org/doc/, grab a book (Joe Armstrong's Pragmatic book is a good one) and get started. You'll be surprised how easily you made your first Erlang production system. (If this makes you feel guilty and you need to self-flagellate afterwards you can try packaging your app into a release.)