Storage classes inside

Storage classes inside

How Standard and Express run one write protocol on different buckets, and what each class costs.

A stream's class decides where its newest records are written and how soon an append is acknowledged. Standard writes each flight to one standard bucket and lets it fill for up to 200 ms. Express writes each flight to an express bucket in every availability zone, waits at most 25 ms, and acknowledges once two zones confirm. Both classes keep long-term history in the standard bucket, so the class changes the cost and latency of new writes only.

Standard Express: an express bucket in each zone later, denorm later, denorm 1 copy copy 1 copy 2 Stream objects, standard bucket Flight Standard bucket Ack Flight Zone a Zone b Zone c Ack
One protocol on two bucket sets. Standard acknowledges at one copy, Express at two of three zones. Both keep history as stream objects in the standard bucket.

The parts

PartWhat it does
Bucket set (K)The buckets each slot is written to: one standard bucket for Standard, and one express bucket per availability zone for Express
Copy quorum (W)The copies that must confirm before a slot counts as written: 1 for Standard, 2 by default for Express
LogletThe part that writes one slot to every bucket of the set and reports it committed at W copies. Both classes use it.
FlusherCuts a node's pool of batches into flights, at a size or a deadline that depends on the class
Transit windowThe time a stream's records stay in the shared WAL objects before denorm copies them out

How an Express append is acknowledged

  1. The leader adds the batch to its Express pool. The flusher cuts a flight once 8 MiB has gathered or the oldest byte has waited 25 ms.
  2. The node writes the flight to the same slot in each zone's express bucket at once. Each write succeeds only if no object exists at that key yet.
  3. When W buckets confirm, the slot is committed. The node acknowledges the flight's batches in slot order.
  4. The remaining copies finish later, or not at all. Reads try the bucket in the reader's own zone first, then the others.
  5. Within an hour by default, denorm copies the records into stream objects in the standard bucket. The auditor then deletes the slot from every express bucket.

One protocol, two bucket sets

Standard and Express share the whole write path: the pool, flights, slots, ledgers, the quorum commit, acknowledgements in slot order, and ledger recovery. They differ in the bucket set and its quorum, and in how long a flight may wait. One protocol means one implementation to test and one recovery procedure. The ledger's formal specification checks both shapes, one bucket with one copy and three buckets with two.

StandardExpress
Flight cut8 MiB, or the oldest byte at 200 ms8 MiB, or the oldest byte at 25 ms
Largest flight32 MiB32 MiB
Buckets per slot (K)1 standard bucket1 express bucket per zone, at least 2
Copies to acknowledge (W)12 by default, never fewer, at most K
Durable at acknowledgementIn the region's standard storageIn W availability zones
Slots uploading at once128128
Pool before appends wait256 MiB256 MiB
Backlog before appends wait1,024 flights and 4 GiB1,024 flights and 4 GiB
Time a slot has to reach W copies30 s30 s
Denorm scheduled at the latest24 hours after indexing1 hour after indexing
Long-term storageStream objects, standard bucketStream objects, standard bucket

For Standard, the flight cut, the window, the pool, and the backlog's flight count are novad settings. See the novad reference.

Express acknowledges at the second-fastest zone

With three zones and a quorum of two, an Express acknowledgement waits for the second-fastest copy. One slow or unavailable zone therefore does not delay appends. The quorum stays at two while a zone is down, and the ledger keeps committing on the other two.

Two zones down leave no slot able to reach two copies. After 30 seconds the node stops the ledger and starts a new one, which cannot commit either. Appends wait until a zone returns, or until their own deadlines pass. With only two buckets, losing one zone has the same effect. Three zones give Express its tolerance of one zone failure.

The quorum never drops below two because Express promises that an acknowledged record survives the loss of a zone. Raising it to three lets acknowledged records survive the loss of two zones, and makes every append wait for the slowest zone.

What each class costs

Object storage charges per request. A flusher cuts a flight at 8 MiB or at its deadline, whichever comes first, so the request rate of a node's WAL follows from its write rate:

Node's write rate in the classStandardExpress, three zones
Below 40 MiB/sAbout 5 flights a second, 1 write eachAbout 40 flights a second, 3 writes each
40 to 320 MiB/s1 flight per 8 MiB, 1 write eachAbout 40 flights a second, 3 writes each
Above 320 MiB/s1 flight per 8 MiB, 1 write each1 flight per 8 MiB, 3 writes each

A node writes these whatever the number of streams it leads. Each slot is later deleted from every bucket of its set, so deletes follow the same count.

Express storage costs more per byte than standard storage, so Express keeps records there only for the transit window. Denorm makes an Express stream's records due at most an hour after they are indexed, against 24 hours for Standard. When the auditor keeps up, a busy stream leaves transit sooner on either class, after about 8 MiB and a 5 minute wait. Reads of older records cost the same on both classes, because both read stream objects from the standard bucket.

The Express write path has two settings

The Express write path has two settings: the bucket set and the copy quorum. Every other write-path value in the table above is fixed for Express. The denorm deadline is not part of the write path. It is an auditor setting, on both classes. A shorter slot budget would turn the slow tail of express storage latency into stopped ledgers, and a smaller window or pool would cap the class below what Standard can do. No benchmark has yet shown an Express value that limits throughput.

The other Express flags in the novad reference tune only the store that reads and the auditor's deletes use, never appends, and the Express denorm deadline is --express-denorm-age-cap.

Go deeper

Back to the concept: Storage classes.

On this page