7

Rooms are a tool in socket.io servers for keeping track of groups of connected users. You can then iterate the sockets in a room or broadcast to all of them. There's really nothing more to them than that. The server can put a socket into a room or remove one from a room. When a socket disconnects, it is automatically removed from all rooms it is in. ...


3

Rooms are a logical grouping construct and have many benefits out of the box for developers using websockets: Rooms make it easier to broadcast to a given set of clients, without referring to individual socket ids of each client. A client can be or not be in a room, while staying connected. Hence rooms provide logical "subscription" to the event topics/...


3

At a high-level, in your design, the PostgreSQL database is standing in for the Redis cache and/or messaging system. This can be made to work but you could run into scalability issues. When you use a database as a messaging system, managing the state of messages becomes problematic. For example, when you create a new message to be sent, you want to make ...


2

You should not do that. The reason is simple: everytime you have a change you would try to inform them. And this comes with 3 major downsides: 1) You try to reach someone that maybe not reachable. Just because you think there is an open connection does not mean it really is. The information that is has been closed may not have reached you. Based on the ...


2

TCP guarantees that packets will arrive at your application in order - that's one of the main differences between TCP and UDP. If necessary, the TCP stack will buffer up out-of-order packets, and re-sort them before delivering them on to the application. But if the network goes down, then the connection will drop. If that happens, any un-received packets ...


Only top voted, non community-wiki answers of a minimum length are eligible