Hi,
There are a couple of things that I couldn't understand. If you can
clarify these, I'll really appreciate it.
We can use redis in two ways.
- First, we can use it as a storage so whenever we spawn a new
process, we can attach the new
socket.io process to it and socket
states can be shared.
- Second, we can also use it for pub sub. So redis can also handle pub
sub.
Have I understood correctly? If so, does redis emit messages to the
clients? Does it mean that the heavy job will be on redis if we use
pub sub as well? (which means we'll be mainly scaling redis if we are
sending lots of messages). So, if I am broadcasting a message to 100
people, will
socket.io send the message to redis and than redis will
send to 100 people? If all these correct, does it mean I should expect
a better performance when using pub sub as well? If not, why should I
use pub sub? What is the use case?
I may have understood completely wrong too, I am a bit confused.
Thanks in advance,