user3658423
user3658423

Reputation: 1944

Node.js/Socket.io realtime webpage push updates

I am looking to implement/add realtime push notification updates from node.js server to browser (client).

I looked into socket.io (http://socket.io/docs/rooms-and-namespaces/)

business requirement is - users will visit a page displaying customer info & their orders. There will be ~10,000 users visiting the page at any given time (all 10,000 could be for different customers or sometimes a user may have opened the same page in 2 or 3 tabs)

When orders flow in to elasticsearch for a customer (my datastore) i want to push notification to users who have that customer's page opened.

Questions:

  1. Is socket.io the correct framework for this case?
  2. Am I correct in understanding I have to use socket.io' rooms functionality to implement this? (each room identifier equals customer ID?)
  3. Is this implementation scalable and would it be memory intensive for 10k users on node.js server?

Thanks!

Upvotes: 0

Views: 862

Answers (1)

Chris B.
Chris B.

Reputation: 382

  1. Yes, but you could consider socksJS as well and write your own simple back-end.
  2. Yes, it's the easiest way if you need authentication.
  3. Worst case scenario you'd need to cluster your socket.io servers and use a back-end adapter. Redis should be fast enough for 10.000 connections.

EDIT: memory will depend on your specific implementation.

Also consider https://github.com/Automattic/socket.io/issues/1393

Upvotes: 1

Related Questions