Storage classes
A stream's class sets how Nova stores new records, trading the speed of an acknowledgement against storage cost.
A stream's storage class decides where Nova writes new records before it acknowledges them. Standard, the default, writes to standard object storage. Express writes copies to faster storage in several availability zones. Both acknowledge an append only after object storage has stored the records, so both classes are durable: the class changes speed and cost.
{
"stream_id": "01a20485-cfc9-7ee8-a2e0-e0af40707ab9",
"bucket": "demo",
"key": "hot",
"kind": "plain",
"class": "express",
"producer_policy": "any",
"timestamping_mode": "client-prefer"
}Standard
Nova groups the batches of many streams and writes them to standard object storage as one object. It waits up to 200 ms to fill the object, or less once 8 MiB is waiting. Then it writes the object and acknowledges every batch in it. An acknowledgement typically takes a few hundred milliseconds.
Standard object storage, such as S3 Standard, keeps each object in at least three availability zones. Grouping many streams into one write keeps the number of storage requests, and their cost, low. Use Standard for high-volume streams where a few hundred milliseconds is fine: telemetry, change feeds, logs, and audit history.
Express
Nova waits up to 25 ms, then writes a copy of the new records to an Express bucket in each availability zone. It acknowledges once two copies are stored. An acknowledgement typically takes tens of milliseconds.
Nova itself copies the records across zones, so writes go on while two zones answer. If fewer than two answer, appends fail until enough zones are back. Use Express when a producer waits on each acknowledgement and the wait must be short: interactive sessions, order flow, and control messages.
Older records
In both classes, a background process later rewrites records into objects of their own stream in standard storage. Express keeps records in Express storage for at most an hour by default, so long history is billed at standard storage prices. Reads work the same way in both classes, and a read of recent Express records prefers the copy in its own zone. Storage classes in Architecture shows how each class writes, copies, and acknowledges.
Comparison
| Standard | Express | |
|---|---|---|
| Typical acknowledgement | A few hundred milliseconds | Tens of milliseconds |
| Copies when Nova acknowledges | One object, kept in three or more zones by the storage | Two or more, one per zone, written by Nova |
| A zone fails | The storage handles it | Writes go on while two zones answer |
| Storage for new records | Standard object storage | Express storage, for up to an hour |
| Storage for older records | Standard object storage | Standard object storage |
| Use when | Throughput and cost matter more than a few hundred milliseconds | A writer waits on each acknowledgement |
Choosing a class
Use Standard unless a writer waits on each acknowledgement. Set the class in a bucket's defaults to apply it to every new stream, or per stream when you create it.
You can change a plain stream's class later. Its producers reconnect once, and appends after the change use the new class. Records already stored keep their class until they move to standard storage like any other. A scalable stream's class is fixed at creation. Settings says when each setting can change.
Express needs an operator to set up an Express bucket in each zone. On a cluster without them, you can still create an Express stream, but appends to it fail. See object storage.
How it works: Storage classes inside.