How to communicate 2 node server with high performance.

57 views
Skip to first unread message

Arun Kumar Raga

unread,
Feb 6, 2017, 3:29:07 PM2/6/17
to nodejs
Hi All,
 
    1) How can i share the global variables in node cluster environment, Currently i am using NEDB for global data and running in another server and communicating both MAIN server and NEDB Server(global data) using http request(facing this issue).

   Is their any better approach is their to communicate two nodejs server or Any better approach to keep global variable data(last state persistence).

  Thank You in advance.

Muhammad Wasim

unread,
Feb 7, 2017, 10:27:45 AM2/7/17
to nod...@googlegroups.com
Take a look at Redis. You can use it as server memory. Multiple servers can use the same memory. The best thing is you can use socket broadcast between servers for communication.

Muhammad Wasim

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/8b47ccaf-255f-42d1-9069-1a2720cc21ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards,
Muhammad Wasim | Lead Software Engineer | Zigron Inc.
E-mail: muhamma...@zigron.com
Website: www.zigron.com

Zlatko

unread,
Feb 7, 2017, 10:27:45 AM2/7/17
to nodejs
If I read that correctly, you're using node-cluster or similar clsutering technique and want some global state. You already provided an answer, you need an external persistence store. That can be something like what you're using (but with persistence enabled), Redis, an external database, like MongoDB or similar, even filesystem. Just make sure that your chosen solution doesn't allow for stale records (or decide you can tolerate some) and see what's the best option for you.

Reply all
Reply to author
Forward
0 new messages