Turso Sync brings local-first SQLite with push and pull
Brief
Turso Sync is a new local-first sync approach for Turso Database: writes stay local until pushed, while pull() fetches remote changes.
How sync works
- The client sends logical row changes rather than SQLite physical pages; push() and pull() are separate calls.
- Reads and writes use the local database file. Offline writes remain on disk until the app can push them.
- Long polling can keep pull() waiting for new changes; checkpoint() compacts the local WAL, and stats() reports sync activity.
Performance and limits
- In the published tests, sequential updates were 10.5x faster and used 14.8x less data; sequential inserts were 8.9x faster and used 16.3x less data than Embedded Replicas.
- The 312x result for pushing once after 200 writes is not a like-for-like comparison: Embedded Replicas made a network round-trip per write, while Turso Sync pushed once.
- Conflicts use last-push-wins, so offline changes to the same row can overwrite one another. Partial sync is experimental.
Availability and migration
- Turso recommends Turso Sync for new projects and suggests existing Embedded Replicas users switch; the libSQL SDKs still support Embedded Replicas.
- On first connection, the local database bootstraps from the remote unless bootstrapIfEmpty: false is set.
- Turso Cloud includes 3 GB of monthly syncs on Free and 10 GB on Developer.
Generated by AI from the original article. Check the source for full details.