Set up object storage

Set up object storage

Give Nova one standard bucket for every record, and optionally one Express bucket per zone.

Nova keeps every record in object storage. A node holds no record data on its own disk, so the bucket is the only copy of your data and the one thing every node must reach. You give Nova one standard bucket. To offer the Express class, you also give it one express-class bucket in each availability zone.

Setting up storage does not touch running clients. Adding Express buckets means restarting each node once, and clients reconnect and retry while it restarts.

Choose the buckets

BucketsWhat Nova writes thereDurable when Nova acknowledgesUse when
One standard bucketNew records, then each stream's long-term objectsAs durable as the standard bucket; AWS S3 keeps it in several zonesEvery deployment. It is enough unless a writer waits on each acknowledgement.
Plus one express bucket per zone, at least twoNew records of Express streams, for up to an hourIn two zonesWriters that need acknowledgements in tens of milliseconds

Express buckets hold only recent records. Nova copies each Express stream's records into the standard bucket, by default within an hour of the write, then deletes them from the express buckets. You pay express prices for that window only. Storage classes explains the choice from the application's side.

Before you start

  • A bucket in the region where the nodes run. On AWS, block public access and turn on default encryption, as the reference deployment does.
  • Credentials the nodes can use. Nodes read them from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, from a shared profile, or from an IAM role. The reference deployment grants exactly these actions on the bucket: s3:ListBucket, s3:ListBucketMultipartUploads, s3:GetBucketLocation, s3:GetObject, s3:PutObject, s3:DeleteObject, s3:AbortMultipartUpload and s3:ListMultipartUploadParts. For Express buckets, add s3express:CreateSession.
  • No lifecycle rule that expires objects. See Lifecycle rules.

Point the nodes at the bucket

Start each node with the bucket

novad --dir /var/lib/nova --listen :7780 --metrics-listen :9090 \
      --s3-bucket nova --s3-endpoint http://rustfs:9000 --s3-region us-east-1 --s3-path-style
--s3-bucketNOVAD_S3_BUCKET
The standard bucket. Every node of a cluster names the same one.
--s3-regionNOVAD_S3_REGION
The bucket's region.
--s3-endpointNOVAD_S3_ENDPOINTDefaultAWS S3
The endpoint of an S3-compatible store, such as RustFS or MinIO. Leave it out on AWS.
--s3-path-styleNOVAD_S3_PATH_STYLE
Path-style addressing, which most stores other than AWS need.

The node logs the store it uses:

[INFO] novad: S3 storage storage=s3 s3_bucket=nova s3_endpoint=http://rustfs:9000

Write a record and find its object

Create a stream, which also creates the bucket demo when it is missing, and append to it:

nova stream create --bucket demo --key events
printf 'hello\nworld\n' | nova append nova://demo/events

The append answers:

appended 2 entries

The batch is now an object in the bucket, under wal/:

wal/f86e/01a204e3-6e3e-7e36-afc9-7d7390252157/1/00000000000000000000

What Nova writes

Each node writes the records it accepts into its write-ahead log, the WAL, as one object per group of batches. Later, the auditor copies each stream's records into stream objects of their own and deletes the WAL objects it no longer needs. Both live in the same bucket:

PrefixHoldsWritten
wal/<hash>/<node>/<epoch>/<slot>New records of Standard streams, mixed across streamsOne object per 8 MiB of appends, or one every 200 ms while appends trickle in
streams/<bucket>/<stream>/…One stream's older recordsWhen the auditor copies them: 5 minutes after a stream gathers 8 MiB, or 24 hours after the write at most

The four hex characters after wal/ spread each ledger over its own part of the key space, so S3 can split its request load between nodes. --wal-key-layout star writes wal/<node>/<epoch>/<slot> instead, the layout older releases read; see Upgrades before you change it. Every key Nova reads or deletes comes from its metadata. It lists only the WAL prefix of a node you decommissioned, to clean it up. An idle node writes nothing. The storage layout describes each key.

Lifecycle rules

Nova deletes its own objects, and the auditor waits until no reader can still need one. A lifecycle rule that expires objects can delete records Nova still points at, and reads of them then fail. The only rule the reference deployment sets aborts multipart uploads left incomplete for 7 days. It leaves versioning off.

Storage credentials

On machines and in Docker, put the keys in the node's environment, or give the machine an IAM role. On Kubernetes, give the cluster resource a Secret with the keys or a ServiceAccount for an IAM role; see Install Nova on Kubernetes. Scope the role to the bucket, and add s3express:CreateSession on the express buckets.

Add Express buckets

An express bucket lives in one availability zone and answers writes in a few milliseconds. Nova writes each group of Express appends to every express bucket at once and acknowledges once two of them confirm. With three zones, the slowest bucket never delays an acknowledgement, and a zone that fails does not stop writes.

Create one bucket per zone

On AWS, create an S3 Express One Zone directory bucket in each availability zone the nodes run in. A directory bucket's name ends with its zone ID, such as nova-exp--use1-az4--x-s3.

Restart every node with the bucket set

Give every node the same zone=bucket pairs, and its own zone with --zone. Restart the nodes one at a time.

nova-1, in a stack where RustFS stands in for the express buckets
novad --dir /var/lib/nova --listen :7780 --fleet-listen :7790 --metrics-listen :9090 \
      --advertise nova-1:7780 --zone az-1 \
      --oxia-server-peers nova-1:6660,nova-2:6660,nova-3:6660 \
      --s3-bucket nova --s3-endpoint http://rustfs:9000 --s3-region us-east-1 --s3-path-style \
      --s3-express-buckets az-1=nova-exp-az1,az-2=nova-exp-az2,az-3=nova-exp-az3
--s3-express-bucketsNOVAD_S3_EXPRESS_BUCKETSDefaultdisabled
The bucket set, one zone=bucket pair per zone. At least two pairs.
--s3-express-ack-quorumNOVAD_S3_EXPRESS_ACK_QUORUMDefault2
How many buckets must confirm before Nova acknowledges. Nova raises a lower value to 2, and it cannot exceed the number of buckets.
--zoneNOVAD_ZONE
The node's zone. Reads prefer the express bucket in the same zone.

On AWS, label zones by zone ID (use1-az4), the ID the bucket name carries, and leave out --s3-endpoint so each bucket is reached at its zonal endpoint. Nova refuses a label that names another zone's bucket, and path-style addressing:

[ERROR] novad failed err="novad: invalid configuration: --s3-express-buckets: zone \"use1-az4\" names bucket \"nova--use1-az5--x-s3\", which lives in \"use1-az5\""
[ERROR] novad failed err="novad: invalid configuration: --s3-express-buckets: directory bucket \"nova--use1-az4--x-s3\" cannot use path-style addressing (--s3-path-style)"

Check that Express writes land in every zone

Each node starts a second WAL for Express:

[INFO] wal: ledger minted star=01a204e3-6e3e-7e36-afc9-7d7390252157 epoch=4 class=express layout=star priors_fenced=0

Create an Express stream and append to it:

nova stream create --bucket demo --key fast --class express
printf 'one\ntwo\n' | nova append nova://demo/fast
nova://demo/fast
  ID:             01a204ea-2d3f-7a86-a0d2-0f2e61e913b7
  Class:          express
  Producer:       any
  Retention age:  unlimited
  Throughput:     unlimited
  Created:        -
appended 2 entries

The same object is now in all three buckets:

nova-exp-az1: wal/01a204e3-6e3e-7e36-afc9-7d7390252157/4/00000000000000000000
nova-exp-az2: wal/01a204e3-6e3e-7e36-afc9-7d7390252157/4/00000000000000000000
nova-exp-az3: wal/01a204e3-6e3e-7e36-afc9-7d7390252157/4/00000000000000000000

Give every node the same bucket set

A cluster accepts an Express stream even where --s3-express-buckets is not set, and every append to it then fails. Set the bucket set on every node that may lead an Express stream.

Express keeps two copies even when zones fail. When two buckets cannot confirm a write, the node retries it for up to 30 seconds. Then it closes its current ledger, starts a new one, and writes the waiting appends again, so producers see a delay. While two zones stay down, appends wait.

Three flags look like Express tuning but do not change how Express appends are written: --s3-express-parallel-uploads, --s3-express-memory-buffer-mib and --s3-express-publish-deadline. They configure the store that serves Express reads, and the first also sizes each zone's pool of warm connections. The Express write path uses fixed values: 128 uploads at once, a 256 MiB buffer, and 30 seconds for each write.

Express on RustFS

RustFS has no zones or express class, so for a test three ordinary RustFS buckets stand in for the bucket set. They exercise the quorum writes, the reads that prefer the local zone, and the deletes that reach every bucket. They do not give express latency. The local stack runs this shape.

If it goes wrong

SymptomLikely causeWhat to do
Appends to an Express stream fail with no write strategy registered for durability mode expressThe node that leads the stream has no --s3-express-bucketsSet the same bucket set on every node
The node exits with novad: express: fanout: ack quorum must be in [1, 1], got 2--s3-express-buckets names one bucketName at least two buckets, one per zone
zone "…" names bucket "…", which lives in "…"A zone label and its directory bucket disagreePair each zone ID with the bucket named for it
directory bucket "…" cannot use path-style addressing--s3-path-style with directory bucketsLeave out --s3-path-style on AWS
novad: s3 warm-up incomplete … failed=… at startThe node cannot reach the bucket yetCheck the endpoint, the region and the credentials. The node retries while it serves.
Reads of older records fail and objects are missingA lifecycle rule expired themRemove every expiry rule. Nova cannot rebuild deleted objects.

See also

On this page