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.
ReadConsistency enum controls how read positions are persisted to disk, allowing you to choose between strict exactly-once semantics and higher-throughput at-least-once delivery.
Enum Definition
Variants
StrictlyAtOnce
Persists every read checkpoint immediately to disk.- Exactly-once read semantics
- Every consumed entry is durably marked as read
- No entries are replayed after a crash
- Lower throughput due to frequent persistence
- More disk I/O for checkpoint updates
- Financial transactions
- Critical event processing where duplicate processing is unacceptable
- Systems requiring strict consistency guarantees
AtLeastOnce
Persists read checkpoints every N entries.Number of entries to consume before persisting the checkpoint to disk. Must be ≥ 1.
- At-least-once read semantics
- Up to N entries may be replayed after a crash
- Higher throughput with controlled replay window
- Higher read throughput
- Reduced disk I/O for checkpoints
- Batches checkpoint persistence
- Event streaming where duplicate processing is acceptable
- Analytics pipelines with idempotent consumers
- High-throughput systems prioritizing performance over strict ordering
Choosing a Consistency Model
| Requirement | Recommended Model |
|---|---|
| No duplicate processing allowed | StrictlyAtOnce |
| Maximum read throughput | AtLeastOnce with high persist_every |
| Idempotent consumers | AtLeastOnce |
| Financial/critical operations | StrictlyAtOnce |
| Event streaming | AtLeastOnce |
| Minimize crash recovery time | AtLeastOnce with low persist_every |
Replay Window Calculation
WithAtLeastOnce { persist_every: N }:
- Maximum entries replayed: N entries
- Actual entries replayed:
(total_consumed % N) - Replay window size: Depends on entry size and throughput
Behavior with Batch Operations
Bothread_next() and batch_read_for_topic() respect the consistency model:
Configuration Examples
Maximum Durability
Balanced Performance
Maximum Throughput
Related Types
- Walrus - Main WAL instance
- FsyncSchedule - Controls when writes are flushed to disk
- Entry (WalEntry) - Structure returned by read operations