Skip to main content

Persistence and distribution

Calling this an in-memory engine describes its speed, not its durability or its scope. It has both, and they are the reason it is a platform component rather than a cache.

Persistence​

MechanismWhat it does
A filesystem write-ahead logWrites land in a durable log, so a restart replays rather than losing the keyspace
WAL attestationThe log is attested, so its integrity is checkable rather than assumed
SnapshotsPoint-in-time state, for recovery and for moving a structure between cells
Tiered spillCold keys move out of RAM to durable tiers rather than being lost

The write-ahead log is the primary durability story and it is the engine's own, not borrowed. Structures does not persist through the SQL database; it has its own log, its own snapshot format and its own recovery path.

Encryption at rest​

The core engine, not only the Edge Agent, can seal its persisted data at rest. All three durable tiers pass through one seal seam: WAL payloads, snapshot artifacts, and the spill and offload tier, with an optional in-memory value seal that is gated strictly to the most sensitive namespaces. The seam composes the platform's audited crypto primitives rather than rolling its own: the cipher is AES-256-GCM per value, the key is a per-workspace key derived from a per-node storage root key, and the additional authenticated data binds the workspace, the namespace and the key, so a blob sealed for one workspace or namespace fails to unseal under another. Unseal is fail-closed: an authentication-tag mismatch raises rather than returning plaintext.

Two honest qualifications belong here.

  • Sealing is conditional, and fails closed to off. The engine seals only when the node storage key is derivable, which requires the node key passphrase to be configured. When it is not configured, the seam returns no context and the WAL, snapshots and spill are written in the engine's plaintext on-disk format. A sealed-value version prefix distinguishes sealed from plaintext records, so a store can carry both across a rollout. The posture is therefore: at-rest encryption is implemented and wired into the core persistence path, and is in force when the node storage key is configured.
  • Key rotation is supported with a bounded drain. Rotating the node storage key keeps the retired key readable only while a rotation is pending, so a restart after rotation can replay a WAL tail written under the old key and reseal it onto the new one. Once an operator purges the retired key the store is single-key again, and the purge is what makes the rotation forward-secret.

This reaches parity with the FluxDB data-protection story on the point that matters: the durable bytes a captured disk would expose are sealed under a real key hierarchy, not left as the soft underbelly of an otherwise governed engine, when the node key is configured.

Backup, restore and recovery​

Durability has two independent paths, and it is worth being precise about what each one is rather than implying a point-in-time rewind the engine does not have.

MechanismWhat it isWhat it is not
SnapshotsPoint-in-time state of a namespace, captured through MVCC without blocking writers, compressed, sealed when a key is configured, and persisted to object storage. Full and incremental snapshots are both supported, each namespace keeps a snapshot history, and a snapshot can be diffed against another (added, removed, modified, unchanged keys). SNAPSHOT, SAVE, BGSAVE and LASTSAVE drive and report themNot a continuous archive. A snapshot is a discrete point, taken on a schedule or on command
WAL replayCrash recovery. On restart the engine replays its write-ahead log from the last durable position, skipping any record that fails its per-record CRC rather than replaying a corrupt tailNot a timestamp-addressable log. Replay is ordered by log sequence number to the tail, not rewound to an arbitrary wall-clock instant
RestoreRestoring a namespace from a snapshot reference rebuilds its keyspace and returns the count of restored keys. Snapshots also move a structure between cells, which is why they are the unit a joining cell is shippedNot an in-place undo of individual commands

Recovery is therefore snapshot plus WAL replay: a snapshot establishes a consistent base and the log carries the keyspace forward from it to the point of the crash. There is no wall-clock point-in-time recovery to an arbitrary earlier instant; the recovery target is the log tail, and the earlier-state tool is the nearest snapshot. Stating that plainly is the honest version of the data-protection story, and it is marked here as the boundary rather than papered over.

Spilling beyond RAM​

This is the property that most separates it from a cache, and it has a specific consequence worth stating.

Cold keys spill through three tiers:

TierWhereRestored
HotIn-process, memory speedAlready there
WarmLocal durable storageTransparently on access
ColdObject storagePromoted back to warm on a hit

Victim selection is least-frequently-used, then least-recently-used, so what leaves memory is what the workload actually stopped caring about. The mechanism is codec-agnostic: the caller serializes an entry using the engine's own snapshot codec, and the tier backends move bytes.

The consequence: a structure can exceed a cell's RAM. Combined with placement across cells, a single logical structure can exceed even the pooled RAM of the whole cluster. That is not a thing a cache can do, and it is the difference between a data structure you size to memory and one you size to your data.

Distribution across cells​

Placement follows the Redis Cluster model: CRC16 hashing over 16,384 slots, with {hashtag} co-location so related keys land together, and MOVED and CROSSSLOT responses so a standard cluster-aware client follows a redirect without special handling.

What decides slot ownership is the platform's own topology rather than a flat hash: slots are placed by CRUSH placement with failure-domain spread, the same machinery that places storage shards, with a single-cell fast path so a one-cell deployment pays nothing for the distribution model.

Replica policy is per structure type​

A uniform replica count across every structure type is a waste in one direction and a risk in the other, so the distribution table declares a replica count and an affinity per type:

  • Probabilistic sketches declare zero replicas. A Bloom filter, a HyperLogLog or a t-digest is an approximation that can be rebuilt, and spending high availability on one is spending it in the wrong place.
  • Graph, vector and geospatial types declare same-zone affinity, because those are latency-sensitive and placement should keep them close.

A resolver applies the per-type policy, clamped to what the topology can actually satisfy.

Convergence​

Cross-cell writes converge through the conflict-free replicated data types in the type surface: a counter, a register, a flag, a set and a map, with last-writer-wins, positive-negative counter and observed-remove semantics.

Around them: a replicator, resync with records, reconcile, a consistency resolver, flow control, and resharding when the slot map changes.

The reason CRDTs matter here specifically is the disconnected case. A device or a partitioned cell can keep accepting writes and converge deterministically when it rejoins, with no central arbiter to be unreachable.

Protection during failover​

A distributed store's real test is what it does when a primary is isolated but still running.

Structures reuses the platform's epoch fence. When a cell is promoted to own a partition it acquires the fence, which monotonically bumps the epoch, so any token held by a now-isolated old primary becomes stale. A write validates its token or epoch before serving, so a partitioned old primary cannot serve stale writes.

That is an explicit rejection layer on top of the strong-consistency quorum, which already prevents a partitioned primary's writes from reaching durable acknowledgment. Two independent mechanisms, because split-brain is the failure mode where one is not enough.

Partitions are keyed by structure namespace, so the fence is scoped to the thing that actually failed over.

What else the distribution layer carries​

CapabilityWhat it is for
TransactionsAcross the distributed keyspace
SnapshotsFor recovery and relocation
Materialized views and aggregationDerived structures maintained across cells
Scope and scope authorizationWhich workspace a structure belongs to, and who may reach it
MeteringPer-command consumption, attributed
Service-level objectivesDeclared targets for the distributed keyspace
Ontology bindingStructures bound to the customer's object model