electric
electric copied to clipboard
What does "Multiplayer-native" mean in the readme?
Might need a clarifiaction, I tried googling and couldn't find anything
Thanks 🙂
Hi @oscarhermoso, thanks for the question!
It means the app you build will automatically sync between concurrent users. You can see this when running the starter app, just open 2 tabs and anything you write in one tab will automatically show up in the other.
What do you think we could add to the readme to clarify this to the users?
In the TodoMVC demo, code-wise it's just a regular old TodoMVC but if you run in two tabs it stays in sync
What happens on conflicts? How does it compare to CRDT's?
Transactional vs conflict-free is a userland choice; streaming a mouse coordinate signal, for example, is not transactional. If userland wants to write to a shared reference, you'll need to provide a conflict resolution strategy, many libraries to choose from. The default choice of "atom with reset!" encodes a race, "atom with swap!" is perhaps the simplest possible transaction.
Take the demo-chat for example - if two users send a message at the same time, the atom serializes the events and they race. https://github.com/hyperfiddle/electric/blob/master/src-docs/user/demo_4_chat.cljc#L27