سؤال

  • MsgPack ?
  • JSON-RPC ?
  • Socket.io (is it possible ? how ?)

EDIT: I am talking about 2 node processes each one on a different physical machine;

I don't understand how redis can help me on this...

هل كانت مفيدة؟

المحلول

I'm not really clear on whether you are looking for ways to make two node servers on two physical machines "talk to each other", or two node.js server processes on one machine.
(You could edit your question to make it clearer).

You could look at:

Note: some of these may need some updating

I hope this helps

نصائح أخرى

I would go for redis. The pubsub semantics are pretty sweet. The node_redis client library is very fast because it can use the lightning fast c-extension-library named hiredis. I would just use json as my encoding. That will probably be more than fast enough.

You could also use DNode to do your communication if you like. I also believe it has socket.io capabilities. You should have a look at the source code to find this out.

It is not really clear from your question what do you mean by a Node server talking to another server. You can use anything from sending UDP packets, making TCP connections, HTTP connections to using any of the high-level mechanisms that others have already pointed out.

For an interesting scenerio of Node processes communication you may take a look at the 2010 JSConf.eu talk by Mikeal Rogers. He explains how to use CouchDB to do that. Very interesting talk.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top