Documentation 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.
What is Walrus as a Library?
Walrus can be embedded directly into your Rust application as a high-performance Write-Ahead Log (WAL) library. This gives you complete control over data persistence, consistency guarantees, and storage configuration without running a separate distributed cluster.When to Use Library Mode
Use Walrus as a library when:- Single Process: Your application runs in a single process and doesn’t need distributed coordination
- Embedded Storage: You need a reliable, fast WAL for state management, event sourcing, or data pipelines
- Custom Control: You want fine-grained control over consistency models, fsync schedules, and storage backends
- Low Latency: You need sub-millisecond write and read operations without network overhead
When to Use Distributed Mode
Consider distributed Walrus when:- Multiple Processes: Your workload spans multiple machines or processes
- High Availability: You need replication and failover capabilities
- Horizontal Scaling: Your throughput requirements exceed a single machine
- Remote Access: Clients need network access to the log
Key Features
High Performance
- Optimized for concurrent reads and writes
- Block-based storage with 10MB blocks (1GB files)
- Support for io_uring on Linux for parallel I/O (FD backend)
- Minimal allocation overhead
Topic-Based Organization
- Independent read cursors
- Separate write streams
- Isolated checkpoint positions
Configurable Consistency
Choose the right trade-off between durability and performance:Dual Storage Backends
Walrus supports two storage implementations: FD Backend (Default)- Uses file descriptors with
pread/pwritesyscalls - Batch operations use io_uring on Linux for parallel I/O
- Supports O_SYNC mode for synchronous writes
- Best for: Linux systems, batch-heavy workloads
- Memory-mapped file I/O
- Sequential batch operations (no io_uring)
- Cross-platform compatibility
- Best for: Non-Linux platforms, Windows
Persistent Read Offsets
Read positions automatically survive process restarts:Namespace Isolation
Create isolated WAL instances with separate storage directories:Basic Usage
Builder API (Recommended)
When you need explicit control over the data directory, use the builder API to avoid race conditions with theWALRUS_DATA_DIR environment variable:
Performance Characteristics
- Block size: 10MB per block
- File size: 100 blocks per file (1GB files)
- Batch limits: Up to 2,000 entries or ~10GB payload per batch
- Default fsync interval: 200ms
- Checksum algorithm: FNV-1a 64-bit for data integrity
Environment Variables
Storage directory for all WAL data
Default namespace key for all instances
Set to
1 to suppress debug outputNext Steps
- Basic Operations - Learn about
append_for_topicandread_next - Batch Operations - High-throughput batch APIs with io_uring
- Configuration - Consistency models and fsync schedules
- Storage Backends - FD vs mmap backend selection