-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] Why syncing actions instead of data model? #1
Comments
Great question! For background, I have significant experience with React and Redux and am only getting into To me it was by default — researching how CRDTs (the Commutative kind) work I noticed that CmRDT "operations" are kinda like "actions", they're applied to the state. Redux time travel allows updates to be commutative since we can apply the update at any point in time. The underlying data structure is a pure result of the actions ( The "Conflict-free" part is up to your reducer. If you have conflict-free actions and reducers, you have a conflict-free app. This is not always the case — two peers might dispatch |
Thanks for the explanation, mostly make sense to me 👍 As a side note, earlier this year I built a prototype along this train of thought but synced the underlying data model, Goal of that POC was I would assume in your approach you will persist multiple |
Actions dispatched while offline are stored in the history all the same, and upon new connection are synced. This is all We currently persist all Otherwise: it's as fast as Redux/JS (very fast), actions/updates are emitted to peers at dispatch time (the scuttlebutt protocol is designed to be low latency), and there's very little "heavy lifting" going on, so it's efficient* * With the exception of having to sync all actions on application start — It calls |
Sounds good, is that project up somewhere to see? |
We currently ensure ordering of actions in the reducer by adding a |
Closing this as I think we've addressed the questions :) |
I have significant experience with
scuttlebutt
and related data types (crdt
in particular), andredux-scuttlebutt
looks like a really interesting way to approach syncing among users, just wondering why you choose to sync the actions, instead of the underlying data structures, say thestore
orstate
itself? Wouldn't it be simpler to keep one single source of truth and sync it across users?The text was updated successfully, but these errors were encountered: