Skip to content

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

Turso 4 min read Announcement mediumAdept

Introducing Real-Time Data with Materialized Views in Turso

Turso adds experimental Live Materialized Views to its SQLite-compatible database, using Incremental View Maintenance based on the DBSP framework so views update in time proportional to the size of changes rather than the base tables. SQL queries compile into a DAG of DBSP operators (filter, projection, aggregate, join, merge) through which inserts, updates and deletes flow as deltas applied to the view. Because maintenance is cheap, views carry the same transactional isolation as the rest of the database and reflect uncommitted changes within a transaction and revert on rollback. Recursive CTEs (delay operator) aren't supported yet, and the on-disk format is unstable and not production-ready.

Related posts

  • Turso v0.7.0

    Turso hardMaster

    Turso 0.7 drops the beta label and focuses on performance and robustness for embedded, multi-tenant use: the core no longer blocks on I/O, yields CPU via a new StepResult::Yield, moves to fallible allocation so OOM surfaces as an error, and treats the page cache as a soft limit like SQLite. The MVCC engine gets a linear-merge dual cursor that replaces per-row skiplist lookups (about a quarter of CPU time on write-heavy loads), watermark-driven garbage collection, experimental passive checkpoints that don't stop the world, and smaller row versions. SQL additions include PostgreSQL-style sequences (now backing AUTOINCREMENT), ICU collations, REINDEX, ordered-set aggregates and window-function groundwork. The SDKs gain a SQLite-compatible .NET/EF Core provider, GIL release and FTS in Python, and concurrent transactions in JavaScript.

  • 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.

  • Turso v0.6.0

    Turso mediumAdept

    Turso 0.6 is the first release supporting all major SQLite features, adding experimental multi-process WAL access (OFD locks on Linux, fcntl elsewhere, IOCP on Windows) and VACUUM/VACUUM INTO. SQL additions include production-ready triggers, temp tables, virtual generated columns, CREATE TABLE AS SELECT, partial WITHOUT ROWID support, UPDATE...FROM, FILTER on aggregates, NULLS FIRST/LAST, and INDEXED BY hints. The STRICT type system gains arrays, structs/unions and Postgres-style domains, and MVCC logical logs are now encrypted with AEAD in 32 KiB chunks. SDK changes add query timeouts, async prepare, fixed interactive transactions in the serverless driver, an npm-distributed CLI and a SQLAlchemy asyncio dialect.

  • How Turso made connections to SQLite databases 575x faster

    Turso mediumAdept

    SQLite re-reads and parses the sqlite_schema table on every new connection, so opening a connection to a database with 10,000 tables takes about 23ms. Turso, a Rust rewrite of SQLite, parses the schema once and shares it across connections in the same process. It uses Arc::make_mut copy-on-write, so a connection only clones the schema when it changes it inside a transaction, and committed changes propagate to all connections. New connections then open in about 40 microseconds no matter how many tables exist, which is faster even than SQLite's 130 microseconds for a single-table database.

  • Change Data Capture in SQLite, Without the Triggers

    Turso mediumAdept

    Turso Database, a Rust rewrite of SQLite, has built-in change data capture enabled with a single PRAGMA. It records every committed insert, update, delete and schema change into a regular `turso_cdc` table with transaction IDs, before/after row images and commit markers, so no triggers or WAL decoding are needed. The post compares this to trigger-based sqlite-cdc, the session extension and update hooks, and lists rough edges: decoding uses the current schema, the change table grows until pruned, and capture is per connection. It ends with a restart-safe polling consumer that groups changes by transaction, advances a watermark only at transaction boundaries, needs an idempotent apply step and prunes against the slowest consumer.

The quest for software engineering knowledge.

Look:
Layout: