TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nubskr/walrus/llms.txt
Use this file to discover all available pages before exploring further.
PUT command appends a message to a topicβs write-ahead log. The operation is automatically routed to the current segment leader.
Syntax
The name of the topic to append to. Must be a single word (no spaces).
The data to append. Everything after the topic name (including spaces) is treated as the payload.
Wire Format
Request:Behavior
Write Path
- Client sends PUT to any node in the cluster
- Node looks up the current segment leader for the topic
- If not the leader, request is forwarded via RPC
- Leader checks its write lease (synced from Raft metadata)
- If lease is valid, data is appended to the Walrus WAL
- Response is returned to the client
Lease-Based Write Fencing
- Only the segment leader can accept writes
- Leases are derived from Raft-replicated metadata
- Lease sync happens every 100ms
- Non-leaders return
ERR NotLeaderErrorif they receive a write - Prevents split-brain writes during leadership changes
Segment Rollover
When a segment reaches ~1M entries (default):- Monitor detects the threshold
- Segment is sealed via Raft consensus
- New segment is created with a new leader (round-robin)
- Subsequent PUTs are routed to the new segment leader
- Old segment remains readable from the original leader
Examples
Interactive Shell
One-off Command
Programmatic Usage (Rust)
Batch Writes
Error Cases
Missing Topic Name
Request:Missing Payload
Request:Topic Does Not Exist
If you PUT to an unregistered topic: Request:Write to Non-Leader
Internal error (automatically handled by forwarding):Lease Expired
During leadership transition:Performance Considerations
Throughput
- Single writer per segment: Lease-based fencing ensures one leader
- Latency: ~1-2 RTT for forwarded operations + storage latency
- No data replication: Only metadata goes through Raft
- Segment rollover: Automatic load distribution across nodes
Payload Size
- Maximum frame size: 64 KB
- Larger payloads require splitting across multiple PUT operations
- No built-in compression (handle at application layer)
Ordering Guarantees
- Per-topic ordering: Guaranteed within a topic
- Cross-topic ordering: Not guaranteed
- Offset assignment: Monotonically increasing per topic
Cluster Behavior
Automatic Forwarding
Leadership Changes
- Transparent to clients during normal rollover
- Transient errors during failover (retry)
- New leader elected via Raft consensus
- Old segments remain readable from original leader