Zero 1.7

Query Correctness and Performance

Installation

npm install @rocicorp/zero@1.7

Overview

Zero 1.7 focuses on query correctness, performance, and operational safety. It improves consistency with different encodings across Postgres, the SQLite replica, and the in-memory JS query engine, as well as performance improvements under load.

Features

  • Immutable query result updates: Query result updates now preserve references for unchanged subtrees, improving compatibility with React memoization and Solid reactivity without the earlier eager-expansion regression. (#6093)
  • Additional Postgres scalar types: Zero now syncs selected text-represented Postgres scalar types, including network/address types, pg_lsn, and the isn extension family, as string columns. These columns can also participate in Zero primary keys. (#6099)
  • Replication lag diagnostics: Added a replication.last_total_lag gauge so operators can distinguish actual replication lag from a stalled lag-report stream. (#6042)

Performance

Zero 1.7 is broadly performance-neutral with Zero 1.6 across client and query-engine workloads, with most benchmarks staying within +/-5%.

The clearest improvements are in replication and storage, especially when Zero is processing changes from Postgres:

What improvedResult
Processing a continuous stream of Postgres changes1.86x faster
Processing transactions that change many rows1.73x faster
Copying rows into Zero during initial sync1.07x faster

Fixes

Breaking Changes

None.