Skip to content

v0.23.0 - Replication and cluster operations

Choose a tag to compare

@github-actions github-actions released this 14 Nov 15:59

v0.23.0 - Replication and cluster operations

NonoDB 0.23.0 adds the first complete replication and cluster operation set:
asynchronous primary/replica replication, hot standby, quorum promotion,
leases, automatic election, write routing, and a cluster-wide GUI.

Replication is opt-in. A single-node deployment behaves as before unless
NONODB_REPLICATION_ENABLED=1 is set on a writer.

Highlights

  • Durable ordered replication log. Every committed write transaction is
    recorded with origin, sequence, epoch, document changes, and ordered metadata
    operations.
  • Read replicas and hot standby. Replicas pull over HTTP/TLS/mTLS, apply
    atomically and idempotently, and reject client writes with 403 read_only.
  • Snapshot bootstrap. A fresh or badly lagging replica can seed itself from
    a consistent snapshot, then continue from the ordered log.
  • Metadata replication. Collection creation, TTL, history settings,
    automatic-event settings, secondary/text/fuzzy/vector/geo indexes, and
    conditional subscriptions are replicated and applied in order.
  • Events and live watch. Replicated _events documents remain watchable on
    replicas; live NDJSON/SSE notifications are dispatched after replica commit.
  • History and TTL. Replicas generate history from replicated before/after
    values and keep replicated TTL configuration. TTL expiry remains
    primary-driven and is applied as replicated deletes.
  • Replica acknowledgements and safe retention. Replicas report applied
    sequences; the primary can prune only up to the minimum ack and exposes
    ack-age metrics.
  • Quorum failover. Voter-majority promotion, persisted votes, primary
    leases with self-demotion, candidate election, and source propagation to
    voters and followers.
  • Write routing discovery. write_url, GET /v1/replication/primary,
    GET /readyz/write, and a Location header on read-only write rejections
    let clients and proxies find the current writer.
  • TLS rotation. Server certificates, keys, and the client CA reload without
    a daemon restart; replication clients rebuild TLS settings each pull.
  • GUI Cluster view. One page shows every configured node with role, epoch,
    head, lag, acks, transport health, write URL, source, requests, errors, disk,
    and offline state. The Replication page explains every field inline and
    exposes source/role controls.
  • Live load-test progress. The Cluster tab can show benchmark phase,
    documents loaded, rate, online nodes, writes, primary, and epoch.
  • Operational tests. New multi-host cluster, failover, lease, election,
    metadata, TLS reload, GUI cluster, and large-load scripts.

What is replicated

Document inserts, updates, deletes, atomic batches, SQL writes, TTL deletes,
collection metadata, indexes, history, automatic events, subscription
definitions, and outbox events.

Not replicated: vault document contents, the auth registry, backup jobs,
node-local configuration, and create_database / drop_database. Background
workers must target the primary or write_url.

Breaking changes and upgrade notes

  • Version bumped to 0.23.0 in the workspace, Node client, GUI package, Docker
    Compose defaults, and documentation.
  • Internal collection names meta, history, ttl, and _replication are now
    rejected as user collection names. Rename any existing collection that uses
    one of these names before upgrading.
  • Replication requires the source token to have admin:db (or *:*). There is
    no narrower replication-only scope yet.
  • Replicas are read-only. Point writers, imports, and job workers at the primary
    or the advertised write_url.
  • A replica that bootstraps from a snapshot must use a fresh or disposable data
    directory; do not merge a snapshot into a live database directory.
  • For large write transactions, use NONODB_REPLICATION_BATCH=10 or 20.
    This avoids very large /v1/replication/changes responses and memory spikes.
  • Existing single-node databases need no migration; replication state is
    created only when replication is enabled.

Configuration

New settings include:

NONODB_REPLICATION_ENABLED, NONODB_REPLICATION_ORIGIN,
NONODB_REPLICATION_ROLE, NONODB_REPLICATION_NODE_ID,
NONODB_REPLICATION_SOURCE, NONODB_REPLICATION_SOURCE_TOKEN,
NONODB_REPLICATION_DATABASES, NONODB_REPLICATION_POLL_INTERVAL,
NONODB_REPLICATION_BATCH, NONODB_REPLICATION_BOOTSTRAP,
NONODB_REPLICATION_ADVERTISE_URL, NONODB_REPLICATION_VOTERS,
NONODB_REPLICATION_VOTER_TOKEN, NONODB_REPLICATION_FOLLOWERS,
NONODB_REPLICATION_LEASE_INTERVAL, NONODB_REPLICATION_LEASE_TTL,
NONODB_REPLICATION_AUTO_FAILOVER, NONODB_REPLICATION_CANDIDATE,
NONODB_REPLICATION_CANDIDATE_PRIORITY,
NONODB_REPLICATION_ELECTION_INTERVAL,
NONODB_REPLICATION_FAILOVER_TIMEOUT, NONODB_REPLICATION_PRUNE_INTERVAL,
NONODB_REPLICATION_RETENTION_KEEP, NONODB_REPLICATION_CA_FILE,
NONODB_REPLICATION_CERT_FILE, NONODB_REPLICATION_KEY_FILE, and
NONODB_TLS_RELOAD_INTERVAL.

See the replication and cluster guide
for primary/replica setup, TLS, GUI, CLI, failover, monitoring, and
troubleshooting.

Validation performed

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --locked
  • replication snapshot/pull/apply/epoch/promotion test
  • metadata, index, history, event, subscription, TTL, and live-watch test
  • quorum failover, lease self-demotion, and automatic election tests
  • TLS hot-reload test
  • GUI and GUI cluster tests
  • multi-host cluster test with dynamic joins, acks, failover, and convergence
  • large 7-node load test: 1M documents, two failovers, peak primary RSS 775 MB,
    final 1,018,454 documents across five surviving nodes
  • CI run 43611561836
  • LiveAPISec workflow run 43611873851

LiveAPISec.com

LiveAPISec.com tests: passed

  • Scan: 6af882456cdd24ed1e3acc28
  • Workflow run: 43611873851
  • Commit: fac70dadb1e31bc9ddc68a3e21f0436fb9012515
  • Findings: 0 critical, 0 high, 0 medium, 9 low, 5 info
  • Tests: 400
  • Report artifact: liveapisec-report

Local scripts/security_check.py: 19 passed, 4 warnings, 0 failed.

Assets

Release archives are produced by GitHub Actions for:

  • Linux x86_64
  • macOS x86_64
  • macOS arm64
  • Windows x86_64

Each archive has a SHA-256 checksum.

Container image: ghcr.io/essmos/nonodb:0.23.0 (linux/amd64 and linux/arm64),
also published as 0.23 and latest.

Full changelog

v0.22.0...v0.23.0