Remix.run Logo
torginus 5 days ago

Why do we even need CRDTs? Why can't we have multi-user editors work like multiplayer video games?

The server has the authoritative state, users submit edits, which are then rejected or applied and the changes pushed to others. The users is always assumed to be online for multiplayer editing. No attempt is made to reconcile independent edits, or long periods of offline behavior.

To prevent data loss, when the user is offline and desyncs, he gets to keep his changes and manually merge them back.

I'm sure this isn't a Google genius worthy implementation and fails in the incredibly realistic scenario where thousands of people are editing the same spreadsheet at the same time, but its simple and fails in predictable ways.

gritzko 5 days ago | parent | next [-]

Once I was using Slack on a bad WiFi and it was an adventure. What I saw as "sent" others never saw.

torginus 5 days ago | parent [-]

Yeah it's a common optimization technique I saw from both backend and frontend devs to hide errors and lie about the actual status.

calvinmorrison 5 days ago | parent | prev [-]

sure, i mean that was how early group editing works, but generally you want to preserve state from both (if we both start typing in the same spot, we both add stuff). Also it prevents any offline editing or high...lag editing really. unlike gaming which needs to be realtime this is much softer.

but no you dont need it

torginus 5 days ago | parent [-]

This needs to be as realtime as WhatsApp. If your internet connection gets bad often enough to have trouble supporting WhatsApp, then my heart goes out to you, but thankfully this is clearly not normal for the most of us most of the time.

And if this happens, your experience is going to be terrible anyway.