Hacker News new | ask | show | jobs
by k7d 3035 days ago
We use combination of Redis pub/sub and Websockets. Each document has a unique key and whenever any of the users/clients make a change to it, it's published via that key. Other clients connect via WebSockets to backend and subscribe to the same key in Redis. The notifications are fairly simple.

The complex part is how we sync actual data from clients to server while ensuring consistency. We basically store all data in a tree format and having a diffing logic how concurrent changes can be applied conflict-free in most cases. I'm considering writing a separate post on that.