Zero 1.8
Observability and Replication Reliability
Installation
npm install @rocicorp/zero@1.8Overview
Zero 1.8 improves operational observability, self-hosting options, and replication reliability.
Features
- Request-header forwarding:
zero-cachecan now forward selected incoming request headers, such as proxy or load-balancer headers, to custom mutate and query APIs viaZERO_MUTATE_ALLOWED_REQUEST_HEADERSandZERO_QUERY_ALLOWED_REQUEST_HEADERS. (#6144, thanks @tjenkinson!) - GHCR Docker images: The Zero Docker image is now published to
ghcr.io/rocicorp/zeroin addition to Docker Hub. (#6161) - Initial-sync metrics:
zero-cachenow exports initial-sync metrics for run outcomes, COPY time, SQLite flush time, index creation time, copied rows, copied bytes, and COPY chunks. (#6191) - Serving-lag metrics:
zero-cachenow exports metrics for replica changes that are ready locally but have not yet been fully served to active client groups. (#6157, thanks @tantaman!)
Performance
Zero 1.8 includes targeted improvements for common in-memory ZQL fetches, ordered take maintenance, and CDC changeLog persistence.
The results below compare Zero 1.7 (6863de5f00a3c1e7dc09c83ea3263dec4a94ebee) to Zero 1.8 (6c8b5e5a76f2b4b253b1b9c9c4a8598299d8c975) using 10 separate process-level runs per ref. Values are median-of-medians from the benchmark output, normalized so higher is better.
In-Memory ZQL Fetch
Common in-memory ZQL fetches are faster when there is no active overlay, start cursor, or connection filter. In the measured fetch hot paths, Zero 1.8 is about 2.1x faster by geometric mean. (#6127)
In-Memory ZQL Fetch
Normalized fetch throughput. Higher is better.
Ordered take Maintenance
Ordered take maintenance fetches can now add a redundant leading-column bound for non-nullable leading sort columns, letting SQLite seek into the relevant index range instead of scanning a large partition. In a targeted benchmark with a 100k-row partition and a start cursor near the end, the median fetch time improved from 3.09 ms to 826 ns. (#6184, thanks @tantaman!)
Ordered Take Maintenance
Normalized fetch throughput for a targeted 100k-row SQLite partition benchmark. Higher is better.
CDC Storer Throughput
zero-cache now batches CDC changeLog writes into multi-row inserts, reducing the time spent persisting metadata for large upstream transactions. In the targeted PostgreSQL storer benchmark, Zero 1.8 is about 1.2x faster by geometric mean. (#6142)
CDC Storer Throughput
Normalized payload throughput while persisting replication changes to the change log. Higher is better.
Fixes
- Logical replication could stall indefinitely when the inbound Postgres replication stream went silent instead of reconnecting. (thanks @tantaman!)
- Drizzle 1.0 RC
prepareQueryresults could come back in array mode instead of object mode, breaking Zero's Drizzle adapter. (thanks @typedrat!) - Queries could appear
completewith stale or empty results after reconnect when persistedgotstate was no longer authoritative. - Malformed SQLite replicas could be accepted until later failures instead of being detected during restore/open and recovered through autoreset. (thanks @tantaman!)
- React Native reads using
op-sqlitev17 could crash withiterator method is not callable. - View-syncer pods could exit with
max attempts exceeded restoring replicawhile the first backup was still uploading. - Cold-start view-syncers could be told to restore before a restorable backup existed, causing repeated failed restore attempts.
Breaking Changes
None.