4 ms·
Replicache (https://replicache.dev/ https://replicache.dev/) and clientdb (https://clientdb.dev/ https://clientdb.dev/) are the only productized versions of thi
by lewisl9029 4y ago
Replicache (https://replicache.dev/ https://replicache.dev/) and clientdb (https://clientdb.dev/ https://clientdb.dev/) are the only productized versions of this architecture I'm aware of (please do let me know if anyone is aware of others!).
But the architecture itself has been used successfully in a bunch of apps, most notable of which is probably Linear (https://linear.app/docs/offline-mode https://linear.app/docs/offline-mode, I remember watching an early video of their founder explaining the architecture in more detail but I can't seem to find it anymore (edit: found it! https://youtu.be/WxK11RsLqp4?t=2175 https://youtu.be/WxK11RsLqp4?t=2175)).
Basically the way authorization works is you define specific mutations that are supported (no arbitrary writes to client state, so write semantics are constrained for ease of authorization and conflict handling), with a client-side and server-side implementation for each mutation. The client side gets applied optimistically and then sync'ed and ran on the server eventually, which applies authorization rules and detects and handles conflicts, which can result in client state getting rolled back if authorization rules are violated or if unresolvable conflicts are present. Replicache has a good writeup here: https://doc.replicache.dev/how-it-works#the-big-picture https://doc.replicache.dev/how-it-works#the-big-picture
- anonymousDan 4y agoGreat, thanks. Are they open-source (or are you aware of anything open-source that does something similar)?
- lewisl9029 4y agoReplicache has a commercial license but is source-available. Clientdb is open-source, but doesn't seem as mature yet. I'd love to see more open source solutions in this space too.