Developer builds offline-first Rust sync engine using event sourcing for mobile apps
A developer has open-sourced a custom offline-first sync engine called rust-mobile-offline-sync, built for TrainVision, a mobile platform designed to collect machine-learning training data in low-connectivity environments. The core logic is written in Rust and shared across iOS, Android, and a Rust backend using UniFFI-generated Swift and Kotlin bindings, with SQLite on-device and Postgres on the server. After evaluating existing solutions like Couchbase Lite and ObjectBox, the developer found them too restrictive for custom conflict resolution and chose to build a bespoke engine instead. The solution centres on event sourcing, where devices store an append-only log of domain events rather than mutable state, making sync a matter of exchanging unseen events rather than comparing full entity snapshots. This approach makes sync operations naturally idempotent and eliminates the guesswork typically involved in merging conflicting offline edits.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in