Zero 1.8

Observability and Reliability

Installation

npm install @rocicorp/zero@1.8

You can now use zero-cache from GHCR:

docker pull rocicorp/zero:1.8.0
# or
docker pull ghcr.io/rocicorp/zero:1.8.0

Overview

Zero 1.8 improves observability, performance, and reliability.

Features

Performance

Zero 1.8 speeds up local ZQL queries, ordered limit() queries, and replication after large Postgres writes.

Faster Local Queries

When a query first runs, Zero builds its view from data already synced to the client. For example, for the query:

zql.issue
  .where('closed', false)
  .related('owner')
  .orderBy('createdAt', 'desc')

Zero 1.8 reduces the per-row work for common local scans, filters, and relationship lookups. Views like this can appear sooner and use less client CPU, with local query fetches running 1.57x to 2.36x faster, depending on the query.

Local Query Fetch

Normalized local query throughput. Higher is better.

Ordered limit() Queries

Consider a view showing the top 50 open issues:

zql.issue
  .where('workspaceID', workspaceID)
  .where('status', 'open')
  .orderBy('priority', 'desc')
  .orderBy('created', 'asc')
  .limit(50)

If open issues are sparse, the 50th match can be deep in the ordered data. If an issue enters, leaves, or moves within the top 50, Zero reads around the current 50th issue to determine which issue belongs in the result next.

Zero 1.8 lets SQLite seek directly to that boundary instead of scanning earlier rows again. Boundary fetches are 1.09x faster after 50 rows and up to 300x faster at the end of a 100,000-row index.

Ordered Limit Boundary Fetch

Normalized query-path throughput when refilling an ordered limited view. Higher is better.

Faster Replication After Bulk Writes

A bulk import, backfill, or migration can change tens of thousands of rows in one transaction. Zero records each change during replication, and writing them one at a time could make replication fall behind.

Zero 1.8 writes these changes in batches, making persistence 2.25x to 2.48x faster and helping large transactions reach clients sooner.

Replication Change Persistence

Normalized throughput while recording Postgres changes for replication. Higher is better.

Fixes

Breaking Changes

None.