Skip to content

Configuration Guide

This page shows how to configure each storage tier in your Danube broker configuration.


Danube supports three storage modes, configured under storage.mode in the broker config. The mode determines where sealed WAL segments are exported for long-term durability.

ModeDurable StorageUse Case
localLocal filesystem onlySingle-node, development, edge
shared_fsShared filesystem (NFS, EFS)On-prem multi-broker clusters
object_storeCloud object storage (S3, GCS, Azure Blob)Cloud-native multi-broker deployments

All data stays on the broker’s local disk. No background export, no remote storage.

danube_broker.yml
storage:
mode: local
local_wal_root: "./danube-data/wal"

Hot writes go to a local WAL. A background exporter copies sealed segments to a shared filesystem visible to all brokers.

danube_broker.yml
storage:
mode: shared_fs
local_wal_root: "/var/lib/danube/wal"
durable:
root: "/mnt/danube-shared-segments"

Hot writes go to a local WAL. A background exporter pushes sealed segments to cloud object storage via OpenDAL.

danube_broker.yml
storage:
mode: object_store
durable:
backend: s3
root: "s3://my-bucket/danube"
region: "us-east-1"
# endpoint: "https://s3.us-east-1.amazonaws.com" # optional, for custom endpoints / MinIO
# access_key: "<access-key>" # prefer IAM roles in production
# secret_key: "<secret-key>"

These settings apply to all storage modes.

danube_broker.yml
storage:
metadata_prefix: "/danube"
local_retention:
time_minutes: 2880 # prune files older than 48 hours
size_mb: 20480 # prune when local WAL exceeds 20 GB
check_interval_minutes: 5 # check every 5 minutes
wal:
rotation:
max_bytes: 536870912 # rotate WAL file at 512 MB

The write_buffer block enables double-writing messages to Valkey for crash recovery and warm caching. This is independent of the storage mode, you can combine it with local, shared_fs, or object_store.

Add these lines to enable durability via Valkey:

danube_broker.yml
storage:
mode: local
local_wal_root: "./danube-data/wal"
write_buffer:
backend: valkey
endpoints:
- "redis://127.0.0.1:6379"

That’s it. Every message is now double-written to both the local WAL and Valkey. If the broker crashes, the next broker recovers the buffered messages from Valkey.

danube_broker.yml
storage:
write_buffer:
backend: valkey
endpoints:
- "redis://127.0.0.1:6379"
wait_replicas: 0
wait_timeout_ms: 100
on_wait_timeout: fail
max_cached_closed_segments: 5
FieldTypeDefaultDescription
backendString(required)Must be valkey
endpointsString[](required)Valkey/Redis endpoint URLs. Use one endpoint for standalone, multiple for cluster mode.
wait_replicasInteger0Number of Valkey replicas that must confirm each write. Set to 0 for standalone, 1 or higher for replicated setups.
wait_timeout_msInteger100Maximum time to wait for replica confirmation (milliseconds).
on_wait_timeoutStringfailWhat to do if WAIT times out: fail (reject the write) or ack (proceed anyway).
max_cached_closed_segmentsInteger5How many closed WAL segments to keep cached in Valkey. Older segments are trimmed via XTRIM.
Deploymentwait_replicasDurability Guarantee
Standalone Valkey (dev/test)0Messages survive broker crash, not Valkey crash
Valkey with 1 replica1Messages survive both broker and Valkey primary crash
Valkey Cluster (3+ masters)1Full HA, messages survive any single node failure
PolicyBehaviorWhen to Use
failReject the write, producer gets an errorProduction, never silently lose the durability guarantee
ackProceed with the write, log a warningDevelopment, or when availability is more important than strict durability

This controls how many closed WAL segments Valkey retains. Each segment is typically 512 MB of messages (matching wal.rotation.max_bytes).

ValueValkey Memory (approx.)Coverage
3~1.5 GB per topicLast 3 rotations
5~2.5 GB per topicLast 5 rotations (default)
10~5 GB per topicLast 10 rotations

The timeout for Valkey replica confirmation. Set this based on your network latency to Valkey:

NetworkRecommended Timeout
Same host / localhost50–100 ms
Same datacenter100–200 ms
Cross-AZ200–500 ms

danube_broker.yml
storage:
mode: local
local_wal_root: "./danube-data/wal"
metadata_prefix: "/danube"
local_retention:
time_minutes: 2880
size_mb: 20480
check_interval_minutes: 5
wal:
rotation:
max_bytes: 536870912
write_buffer:
backend: valkey
endpoints:
- "redis://127.0.0.1:6379"
wait_replicas: 0
wait_timeout_ms: 100
on_wait_timeout: fail
max_cached_closed_segments: 5

Start Valkey with Docker:

Terminal window
docker run -d --name valkey -p 6379:6379 valkey/valkey:latest

For a complete broker configuration reference covering all settings, see Broker Configuration.