Model your data
Choose what each stream holds, how to name it, which bucket it lives in, and who writes it.
Modeling data in Nova means choosing what one stream holds. A stream is cheap, keeps its records in one order, and has its own retention. So the usual answer is one stream per thing whose history you keep in order: one order, device, conversation, or job. Group those streams into buckets that share settings. How Nova fits together introduces each part.
tenant-42/orders/8a1f one order's history
tenant-42/orders/9c02 another order
tenant-42/audit the tenant's audit log
device/eu-west/sensor-0017 one device's readings
run/2026-08-24/build-3391 one job's stepsOne stream per thing you keep in order
| Pattern | One stream per | For example |
|---|---|---|
| Entity history | Order, account, or document | Event sourcing, where each entity rebuilds its state from its stream |
| Tenant log | Customer | Audit trails, webhook delivery history |
| Device | Device or sensor | Telemetry, firmware events |
| Run | Job, workflow, or agent session | Step history, build logs |
| Conversation | Chat or thread | Messages, collaborative edits |
| Change feed | Table or shard | Change data capture |
Nova does not order records across streams. Put two records in the same stream when their order matters to you, and in different streams when it does not. A stream that one node cannot keep up with, such as all the clicks of a busy site, can be a scalable stream, which keeps order per routing key instead.
Keys
A key is a name of your choice. Nova does not read it, and a slash is an ordinary character in it. Build keys from IDs that never change, such as a tenant ID and an order ID. A status or an owner can change, so keep them out of keys. A key cannot be renamed, and a stream deleted and created again starts empty, from sequence number 0.
Put the most general part first. You can then list a bucket's streams by key prefix:
nova ls apps --prefix tenant-42/orders/ADDRESS CLASS PRODUCER
nova://apps/tenant-42/orders/8a1f standard any
nova://apps/tenant-42/orders/9c02 standard anyA token can also be limited to a key prefix, so the same convention controls who reads and writes which streams. See API keys and tokens.
Buckets
A bucket gives its new streams their default settings. Group streams in one bucket when they need the same class, timestamping, and retention, or the same permissions. Use separate buckets when they need different ones, such as orders and orders-audit below.
When your application creates keys all the time, such as one stream per session, set the bucket to create a stream on its first append. Writers then append to any address, and the stream appears with the bucket's defaults. Set create-on-read too if a reader may start before the first writer. Buckets has the details.
Choose each bucket's defaults for its streams:
| Setting | Choose | When |
|---|---|---|
| Class | Standard | Throughput and cost matter more than a few hundred milliseconds |
| Express | A writer waits on each acknowledgement | |
| Timestamping | client-prefer | Writers may send event times. This is the default. |
client-require | Every record must carry its event time | |
arrival | Records should carry Nova's time only | |
| Retention | An age or a size | The streams are a buffer: sessions, telemetry, logs |
| None | The streams are your source of truth |
Writers
Decide who writes each stream:
| Who writes | Use | Use when |
|---|---|---|
| Many writers | The default any producer policy. Nova orders their batches as they arrive. | Devices, request handlers, or services append to one log |
| One owner at a time | The fenced policy, and a new fencing token, such as a generation number, for each new owner | A command handler or workflow engine owns the stream |
| Writers whose append depends on the stream | A match sequence number: read up to the tail, decide, then append only if the tail has not moved | An append is only right if nothing was written since you read |
When a new owner fences a fenced stream with its token, the old owner's next append fails. When a conditional append is refused, the error carries the new tail, and you decide again. Writer coordination explains both tools.
Check the tail when you need to know where a stream ends now: before a conditional append, or after an append whose answer you never got.
Example: order history
An order service uses two buckets:
orders, with Express as its default class,fencedas its default producer policy, and streams created on first append. Each order has a stream,orders/<order-id>, which Nova creates with those defaults at its first append. The order's command handler appends with match sequence numbers, and projections subscribe from the start.orders-audit, with Standard andarrivaltimestamping. Each tenant has a stream,orders-audit/<tenant>, with theanypolicy, which every service that touches the tenant's orders appends to. Retention keeps it for as long as compliance requires.
Listing orders gives the order streams, and listing orders-audit gives the tenants.