DEV Community

Manda Putra
Manda Putra

Posted on

What are the right approach to build chat app that scale with socket.io?

Hi I had a bit of thinking problem to figure it out how good chat app really are.

For this case I use socket.io, I think plain Websockets also use this similiar approach, I think...

Send message to user, private message

There a lot example outhere, and it involves saving the socket.id of a websockets, or sockets.io id.

But what are the right approach?

Socket.io had rooms feature, could I just create new unique rooms if there are another people chatting?

Websockets can use redis pub/sub do I should create dynamic redis pub/sub to send messages?

Are these approach are okay if I had 100.000++ users conected to dynamic pub/sub or socket.io rooms mecanism?

There are tools called rabbitMQ, some people recomend it when building chat app or realtime app, what actually its do? It is simplify the app and easy to scale app?

What are message broker? Why is this keep recomended for building realtime apps?

Oldest comments (2)

Collapse
 
mandaputtra profile image
Manda Putra

Yeah ~ let me take a look. Thanks for recomendation. I just wonder how they send private message to current users. How they use their service.

Collapse
 
tingwei628 profile image
Tingwei

typo: "recomend" -> recommend