Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Turso 4 min read Announcement mediumAdept

Introducing Databases Anywhere with Turso Sync

Turso Sync lets local SQLite-compatible Turso databases, in Node or in the browser via WASM, sync with Turso Cloud through push, pull and sync-aware checkpoint methods layered on the standard database API. Local changes are pushed as row-level logical mutations with Last-Push-Wins conflict resolution, and a transform hook lets developers rewrite mutations for custom merge logic. Remote changes are pulled as physical pages, so replicas converge byte-for-byte on the cloud source of truth, which rules out peer-to-peer sync. The launch also adds per-table, per-operation token permissions and external JWKS/OIDC auth (Clerk and Auth0 in beta).

Related posts

  • Building Local-First Apps: The Complete Guide to Offline-First Database Sync

    Turso mediumAdept

    Turso Sync brings local-first behaviour to SQLite-based apps. Local changes are captured via change data capture and pushed as logical row-level mutations, while remote changes are pulled as physical pages so replicas converge byte-for-byte. Turso's benchmarks report up to 312x faster syncs and roughly 18x less traffic than the older Embedded Replicas approach. The guide covers TypeScript setup with background push/pull loops, Last-Push-Wins conflict resolution and a transform hook for custom merges such as turning sets into increments, scoped auth tokens and JWKS, sync-aware WAL checkpointing, and experimental partial sync. It also notes that there is no CRDT or peer-to-peer support, which makes the approach a poor fit for real-time collaborative document editing.

  • Turso Sync: Local-First SQLite with Push and Pull

    Turso mediumAdept

    Turso Sync replaces libSQL's page-based Embedded Replicas with logical row-level changes captured via CDC in Turso Database, a Rust rewrite of SQLite, so reads and writes stay local and apps call push() and pull() explicitly. Shipping logical statements instead of WAL pages lets unrelated writes merge on the server. Experimental partial sync fetches 128 KiB segments on demand, with optional prefetch. Benchmarks show roughly 7–10x speedups and about 15x less data for small-write workloads, but only 1.2x when writes are already batched. Conflicts resolve by last-push-wins, which suits single-writer data but loses updates on shared counters unless data is modeled append-only.

  • Introducing Offline Writes for Turso

    Turso easyNovice

    Turso is opening a private beta for Offline Writes, letting applications write to local embedded SQLite replicas while online or offline and sync those changes to the cloud later. Local writes land in the SQLite write-ahead log, and sync pushes or pulls WAL frames to and from the remote database. Conflict handling stays simple and assumes mostly serialized writers: the first push wins, and the others pick a strategy such as fail-on-conflict, discard-local, rebase-local or a custom resolver. The pitch is that pairing this with a database-per-user design makes local-first apps simpler, because the whole database syncs rather than a selected subset.

  • Bringing SQLite to Vercel Functions with Turso

    Turso mediumAdept

    Turso's partial sync replicates a subset of SQLite database pages into Vercel Functions so reads run in-process with no network round-trip, while writes go to the remote Turso database for durability and consistency. On cold start the driver fetches the first 128 KiB of the SQLite file, then pulls further 128 KiB segments on demand into the ephemeral /tmp directory, so cold-start cost scales with the working set rather than total database size. The experimental @tursodatabase/vercel-experimental package also auto-provisions databases by name for database-per-tenant or per-agent-session patterns. It offers an optional local-write batching mode that trades consistency for lower write latency, and uses a waitUntil() safety net that pushes pending changes if close() is forgotten.

  • Turso Sync: a much, much, much better way to sync

    Turso mediumAdept

    Turso, a Rust rewrite of SQLite, replaces libSQL's Embedded Replicas with a sync model built on change data capture, shipping logical changes instead of physical pages and splitting sync into separate push() and pull() operations. Page-based replication wasted bandwidth, could not resolve conflicts (so writes defaulted to the remote), and diverged around checkpoints, forcing re-bootstraps. In Node.js benchmarks against Turso Cloud, Turso sync was 8.9x faster with 16.3x less traffic for 3,000 sequential inserts, 312x faster for read-your-writes cycles with local writes (7.3x even when pushing after every write), and 2.1x faster for an initial pull. Turso also supports partial, lazy bootstrap, and the recommendation is to switch from libSQL sync to Turso.

The quest for software engineering knowledge.

Look:
Layout: