Hello HN! I’m happy to introduce SQLiteChangesetSync, a Swift package I’m sharing for the first time. It’s designed for offline-first synchronization of SQLite databases across devices. The package uses the SQLite Session Extension for capturing and committing changes in the local database. When the client is online, these changesets can then be pushed to a shared repository, which could be any server or database (example CloudKit implementation included). Other clients can fetch these changesets to keep their local databases consistent.
SQLiteChangesetSync supports branch merging when databases diverge and provides the ability for applications to handle merge conflicts. I've also included a pre-built iOS app in the package, allowing you to run two instances on different simulators to experiment with the syncing process. I’m eager to hear feedback on both the concept and implementation of database synchronization. Your insights are highly valued!
https://github.com/gerdemb/SQLiteChangesetSync
Note: As this project is experimental and self-tested, some challenges are expected. Looking forward to your feedback!
How long did it take you to implement this proof of concept?