Re:Lasp: a little further down the Erlang rabbithole
by rkangel on Wednesday May 10, 2017 @04:29AM
(#14306737)
What CRDT databases do you use in this sort of application?
Re:Lasp: a little further down the Erlang rabbithole
by elcritch on Sunday May 14, 2017 @09:38PM
(#14338536)
Currently 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.
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.