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.
The parts
| Part | What 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 |
| Loglet | The part that writes one slot to every bucket of the set and reports it committed at W copies. Both classes use it. |
| Flusher | Cuts a node's pool of batches into flights, at a size or a deadline that depends on the class |
| Transit window | The time a stream's records stay in the shared WAL objects before denorm copies them out |
How an Express append is acknowledged
- 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.
- 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.
- When W buckets confirm, the slot is committed. The node acknowledges the flight's batches in slot order.
- The remaining copies finish later, or not at all. Reads try the bucket in the reader's own zone first, then the others.
- 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.
| Standard | Express | |
|---|---|---|
| Flight cut | 8 MiB, or the oldest byte at 200 ms | 8 MiB, or the oldest byte at 25 ms |
| Largest flight | 32 MiB | 32 MiB |
| Buckets per slot (K) | 1 standard bucket | 1 express bucket per zone, at least 2 |
| Copies to acknowledge (W) | 1 | 2 by default, never fewer, at most K |
| Durable at acknowledgement | In the region's standard storage | In W availability zones |
| Slots uploading at once | 128 | 128 |
| Pool before appends wait | 256 MiB | 256 MiB |
| Backlog before appends wait | 1,024 flights and 4 GiB | 1,024 flights and 4 GiB |
| Time a slot has to reach W copies | 30 s | 30 s |
| Denorm scheduled at the latest | 24 hours after indexing | 1 hour after indexing |
| Long-term storage | Stream objects, standard bucket | Stream 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 class | Standard | Express, three zones |
|---|---|---|
| Below 40 MiB/s | About 5 flights a second, 1 write each | About 40 flights a second, 3 writes each |
| 40 to 320 MiB/s | 1 flight per 8 MiB, 1 write each | About 40 flights a second, 3 writes each |
| Above 320 MiB/s | 1 flight per 8 MiB, 1 write each | 1 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
WAL, slots and ledgers
Slot states, and what stops a ledger
Storage layout
The express bucket set and how slots are keyed in it
Epochs and fencing
How a ledger is fenced across K buckets
Back to the concept: Storage classes.