sdelements / lets-chat

Self-hosted chat app for small teams
http://sdelements.github.io/lets-chat
MIT License
9.76k stars 1.58k forks source link

Not scalable using replica set #733

Open Annoraaq opened 7 years ago

Annoraaq commented 7 years ago

When using a MongoDB replica set and having two different node instances of lets-chat connect to the replica set, you can't see each others messages util you actively reload the page. This is because the current implementation assumes, that all clients are connected to one node instance and the websockets only push new information to the client if some change occurred on the same node instance. It should also check if there are new messages in the database from time to time. Otherwise the application is not really scalable.

hhaidar commented 7 years ago

You could try adding the redis socket.io adapter to the server, that should let you run multiple instances.

We're working on a little something behind the scenes that should address this issue and a bunch more ;)