MongoDB SocketIO pub sub performace over rooms
I am recently trying an application with NodeJS, MongoDB and Socekt IO.
I just heard of SocketIO stores that can be used to cache the messages over the interaction between clients, I am having some doubts on it.
- Which is better in terms of performance (SocketIO Rooms vs store pub sub) ?
- Will mong.socket.io suffice my requirement?
- Is there any other advantages in selection pub-sub or Rooms?
- Or am i Completely mistaken ?
I think that redis would be the better choice here. (https)://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO
Redis has the great benefit, that its implementation already supports pub/sub functionality native. (http)://redis.io/topics/pubsub
By the way redis is a good choice for storing session data, because it supports expiring ((http)://redis.io/commands/expire) for keys, which means the database cleans up itself. A great advantage is, that redis supports persistence, which sound ideal for restoring for example messages or session data after a crash. (http)://redis.io/topics/persistence
And for high workload there is also a way to replicate: (http)://redis.io/topics/replication