Zero 0.20
Full Supabase support, performance improvements
Install
npm install @rocicorp/zero@0.20
Upgrading
There are two config changes for multinode deployments:
- Required: Remove
view-syncer
'sZERO_CHANGE_STREAMER_URI
env var and replace it withZERO_CHANGE_STREAMER_MODE: "discover"
. - Optional: Change the
ZERO_LITESTREAM_BACKUP_URL
env var from being passed to bothreplication-manager
andview-syncer
nodes to being passed only toreplication-manager
. This config is no longer needed byview-syncer
(and is ignored by it).
See hello-zero for an upgrade example using SST.
Additionally, the ZERO_TENANTS_JSON
, feature was removed. We do not think anyone was using it, but if you were please reach out to us for options.
Features
- Supabase is now fully supported. After upgrading, you should see that schema changes are incremental and don't reset the replica (docs).
- Improve performance of single-key reads on client. Scale depends on size of data but 100x improvement is common (PR).
- Implement short-circuiting for
or
queries. Because of permissions, one or more branches ofor
would often be empty, turning the entireor
into a full-table scan. 100x improvement on chinook test dataset (PR). - Remove DNF conversion. This was intended to make consistency easier in the future, but was resulting in some queries exploding in size (PR, bug).
- Autodiscovery for
replication-manager
.view-syncer
nodes now findreplication-manager
using the Postgreschangedb
database, and no longer need an internal load balancer. See the newZERO_CHANGE_STREAMER_MODE: "discover"
config in the deployment docs (PR). - Make
ZERO_LITESTREAM_BACKUP_URL
specific toreplication-manager
.view-syncer
nodes now ignore this config and learn it fromreplication-manager
instead. This makes restarting replication less error-prone (PR, discussion). - OpenTelemetry support (docs).
Fixes
- Allow dots in column names (only works with custom mutators) (PR).
- Fix websocket liveness check to avoid false negatives when busy (PR).
- Fix unhandled exception in
zero-cache
when processing query eviction (PR). - Keep microsecond precision across timezones (PR).
- Fix unhandled exception in
zero-cache
duringhandleClose
(PR). - Fix
NOT IN
inz2s
(PR). - Mutators: assert provided columns actually exist (PR).
- Fix ordering of columns in replicated index (PR).
- Use a shorter keepalive for replication stream for compat with Neon (PR).
- Allow destructuring
where
inquery.related
(PR). - Add flow control for large change DB transactions (PR).
- Fix
z2s
handling of pg types with params (char, varchar, numeric, etc) (PR). - Support
from
and--schema-path
inanalyze-query
(PR).
Breaking Changes
- The autodiscovery feature for
replication-manager
is a breaking change for multinode deployments. See the upgrade instructions for details. - The
ZERO_TENANTS_JSON
config was removed 🫗. - The
ZERO_INITIAL_SYNC_ROW_BATCH_SIZE
config was removed. It is no longer needed because initial sync now adapts to available memory automatically.