What if your app could combine the simplicity of physical replication with the efficiency of logical replication? Meet Graft: lazy, partial, strongly consistent edge replication.
#OpenSource #EdgeComputing #Replication
https://sqlsync.dev/posts/stop-syncing-everything/
Stop syncing everything

Discover Graft, an open-source transactional storage engine built to solve the challenges of syncing data at the edge. Inspired by lessons from SQLSync, Graft enables lazy, partial, and strongly consistent replication—allowing edge applications to sync only the data they need, exactly when they need it.

@f0a this looks interesting.

Is it intended for single-user databases/content?

Or, if it's for multi-user stuff, then how is the resource ownership and access-control handled?

Where sits the business logic?

@kravemir thank you! Graft supports multiple writers to the same Volume, although it uses optimistic concurrency. So if you have a high number of writes from multiple users to the same database it may not be the right fit. However, Graft can easily handle a Volume per user, which can work well when your data can be sharded. Think of Graft like a building block which you can use to build distributed systems.

Business logic wise, Graft embeds directly in your application just like SQLite!

Hope that helps :)

@f0a how does the optimistic concurrency work in combination with "Offline-first & mobile apps".

What if transaction fails due to optimistic lock issue? And, this is delayed - once client becomes online (which can be long enough for user to do other actions or even create depending depending).

Does the application need to implement a mechanism to handle these delayed rollbacks? The (user's) data shouldn't just silently disappear.

@kravemir Precisely. The application needs to implement a solution to rebase offline mutations on top of the latest authorative state. SQLSync is one such approach which I plan on integrating with Graft, but you could also use a CRDT based data model on top of Graft to permit automatic conflict resolution for example.