4 ms·
My favourite thing about CRDTs (and event sourced data in general) is that they force us to consider the meaning of time and order as it relates to information.
by inopinatus 10y ago
My favourite thing about CRDTs (and event sourced data in general) is that they force us to consider the meaning of time and order as it relates to information. When handled with clarity of thought there are flow on effects in correctness of processing and (my favourite outcome) in POLA consistency i.e. the UX improves - especially in the marginal or edge cases.
The downside is that popular frameworks don't mesh well, or at all, with this paradigm. Trying to shoehorn event-based data into say, Rails (which I've done), is an frustrating exercise in resolving massive impedance mismatches and growing technical debt. Turns out most database-driven MVC frameworks have a very limited understanding of time and order.
CQRS helped here, because I realised that my MVC can and should just be a view & query layer, and I should be building the event sourced/CRDT-based logic elsewhere.
- elcritch 10y agoGlad to hear someone else describe the benefits of using CRDTs on the UI side. My most recent project currently ignores the time ordering of conflicting events, but it's expissue you done. The crdt foundation gives a free solid design to handle multi user synchronization issues when we need to. Unfortunately, I've come to believe the whole MVC architecture to be an anti-pattern. It's just hard to test, hard to debug, and overall just takes a lot of work to maintain. Luckily I've found that many of the modern JavaScript UI libraries play very well with event sourcing, IMHO. React and Vue.js in particular work very well when combined with Redux/Vuex and a CRDT database. Both of those stores are essentially event sources themselves, where the actions and mutators are separated and the data store itself is updated only in one place. Very quick to,develop with! There are a few server side setups for both React and Vue.js which makes them useable in place of rails, etc. Also Elixir and Phoenix work well since views and controllers in Phoenix are functional.
- rkangel 10y agoWhat CRDT databases do you use in this sort of application?
- elcritch 9y agoCurrently leveraging CouchDB and it's incremental map-reduce to handle the "CRDT" merging of an event stream. Technically I'm not using a CRDT library or DB, but it's surprisingly easy to implement the core "commutative operations" of CRDT's via a modified deep-merge versioning algorithm. Works pretty well as I can deploy 20,000+ user interactions on an embedded CouchDB instance with steady performance. Interesting to note that while the actual data structures don't conflict the oder that multiple users modify data and choosing an ordering (and choosing) of which user events poses a challenge. It's possible with CouchDB DB merging to notify the user's interface that their changes were overwritten by another user or device allowing them to choose.