Viator
A complete Redis-compatible server implementation
Note: Viator is Redis® 8.4.0 protocol-compatible. Redis is a registered trademark of Redis Ltd. Viator is not affiliated with or endorsed by Redis Ltd.
Status
Beta Ready - Verified with viator-cli 8.4.0. All critical issues resolved. Suitable for testing and non-production workloads.
| Category | Status |
|---|---|
| Core Data Types | ✅ String, List, Hash, Set, Sorted Set, Stream |
| Redis Stack | ✅ JSON, Bloom, Cuckoo, CMS, TopK, TimeSeries |
| Persistence (VDB/AOF) | ✅ CRC64 checksums, LZF compression, atomic writes, non-blocking |
| Security | ✅ ACL, TLS, AUTH rate limiting, constant-time password comparison |
| Memory Management | ✅ LRU eviction with Redis-style 5-key sampling |
| Cluster/Sentinel | ✅ Full implementation |
| Lua Scripting | ✅ Lua 5.4, real SHA1, EVALSHA |
| VectorSet | ✅ HNSW-based similarity search |
| Operability | ✅ Accurate INFO metrics, SHUTDOWN SAVE/NOSAVE/ABORT |
Overview
Viator is a complete Redis-compatible server implementation featuring:
- Full RESP3 Protocol - Wire-compatible with Redis clients
- All Core Data Types - String, List, Hash, Set, Sorted Set, Stream, VectorSet
- Vector Similarity Search - HNSW algorithm for semantic search and RAG applications
- Redis Stack Modules - JSON, TimeSeries, Bloom, Cuckoo, TopK, T-Digest, CMS
- High Availability - Cluster mode with automatic failover, Sentinel monitoring
- Persistence - AOF and VDB with CRC64 checksums and LZF compression
- Lua Scripting - Full Lua 5.4 scripting with real SHA1 hashing
- Enterprise Security - ACL, TLS, audit logging, AUTH rate limiting
Installation
From crates.io
This installs all binaries to ~/.cargo/bin/:
viator- Main serverviator-cli- Command-line clientviator-benchmark- Performance benchmarkingviator-check-vdb- VDB file integrity checkerviator-check-aof- AOF file checkerviator-sentinel- High availability monitor
Build from Source
# Clone the repository
# Build in release mode
# Run the server
Quick Start
# Start the server
Using viator-cli
# Connect with viator-cli
# Test basic commands
Configuration Options
Features
Data Types
| Type | Commands |
|---|---|
| Strings | GET, SET, MGET, MSET, INCR, APPEND, GETRANGE, SETEX, SETNX |
| Lists | LPUSH, RPUSH, LPOP, RPOP, LRANGE, LINDEX, LINSERT, LLEN |
| Hashes | HSET, HGET, HMGET, HGETALL, HDEL, HINCRBY, HGETDEL*, HSETEX* |
| Sets | SADD, SREM, SMEMBERS, SINTER, SUNION, SDIFF, SCARD |
| Sorted Sets | ZADD, ZREM, ZRANGE, ZRANK, ZSCORE, ZINCRBY, ZRANGEBYSCORE |
| Streams | XADD, XREAD, XRANGE, XLEN, XGROUP, XACK, XCLAIM |
| HyperLogLog | PFADD, PFCOUNT, PFMERGE |
| Bitmaps | SETBIT, GETBIT, BITCOUNT, BITOP, BITPOS |
| Geo | GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS, GEOSEARCH |
| VectorSet | VADD, VSIM, VGET, VDEL, VCARD, VINFO |
*Redis 8.0+ commands
Redis Stack Modules
# JSON
# Bloom Filter
# Time Series
# Top-K
Vector Similarity Search
HNSW-based vector similarity search for semantic search, recommendations, and RAG:
# Add vectors (128-dimensional embeddings)
# Find similar vectors
# With filtering
# Get vector info
See VECTORSET.md for detailed documentation.
Cluster Mode (Redis 8.4 Compatible)
# Cluster information
# Redis 8.2+ Slot Statistics
# Redis 8.4 Atomic Migration
Sentinel High Availability
# Monitor a master
# Get master address
# Check quorum
Transactions & Scripting
# Transactions
# Lua Scripting
Pub/Sub
# Subscribe to channels
# Publish messages
Architecture
Viator is built on a modular architecture:
┌─────────────────────────────────────────────────────────────┐
│ Client Layer │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────────────┐ │
│ │ RESP3 │ │ TLS │ │ Rate │ │ Connection │ │
│ │ Parser │ │ Support │ │ Limiter │ │ Manager │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Command Layer │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Command Registry (200+ commands) ││
│ └─────────────────────────────────────────────────────────┘│
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Strings │ │ Lists │ │ Hashes │ │ Sorted Sets │ │
│ └──────────┘ └──────────┘ └──────────┘ └────────────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Streams │ │ Geo │ │ JSON │ │ TimeSeries │ │
│ └──────────┘ └──────────┘ └──────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Storage Layer │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ DashMap (Concurrent Hash Tables) ││
│ └─────────────────────────────────────────────────────────┘│
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ Expiry │ │ Pub/Sub │ │ Persistence │ │
│ │ Manager │ │ Hub │ │ (AOF + VDB) │ │
│ └──────────────┘ └──────────────┘ └───────────────────┘ │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Distributed Layer │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ Cluster Bus │ │ Sentinel │ │ Replication │ │
│ │ (Gossip) │ │ Monitor │ │ Manager │ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
For detailed documentation:
- ARCHITECTURE.md - System design and module overview
- COMPATIBILITY.md - Redis 8.4.0 command compatibility spec
- PERSISTENCE.md - AOF and VDB persistence
- SECURITY.md - Authentication, ACL, TLS
- VECTORSET.md - Vector similarity search
Performance
Viator leverages Rust's zero-cost abstractions for high performance:
- Memory Allocator: jemalloc for reduced fragmentation
- Concurrency: Lock-free data structures (DashMap, crossbeam)
- I/O: Tokio async runtime with io_uring support
- Zero-Copy: Bytes crate for efficient buffer management
- SIMD: memchr for fast byte searching
Security
Memory Safety
- Written in safe Rust (
#![forbid(unsafe_code)]) - Eliminates buffer overflows, use-after-free, data races
- Bounds checking on all array/slice access
- NaN-safe float comparisons (no panic on edge cases)
Authentication & Authorization
- ACL system with user permissions and key patterns
- Argon2id password hashing (memory-hard)
- Constant-time password comparison (prevents timing attacks)
- AUTH rate limiting: 10 failures → 60-second lockout
- Command-level access control with categories
Memory Management
- Maxmemory enforcement with configurable limits
- LRU eviction with Redis-style 5-key sampling algorithm
- Volatile-TTL, volatile-random, allkeys-random policies supported
- Real-time memory metrics via INFO command
Network Security
- TLS 1.3 via rustls (memory-safe)
- Rate limiting per IP
- Connection limits and buffer size controls
Lua Sandboxing
- Restricted function set (no os, io, debug)
- Memory and instruction limits
- Execution timeouts
- Real SHA1 script identification (Redis-compatible)
See SECURITY.md for detailed security documentation.
Building
Requirements
- Rust 1.85 or later
- Cargo
Feature Flags
# Default features
# With TLS support
# With OpenTelemetry
# Minimal build
Running Tests
# Run all tests
# Run benchmarks
# Test with viator-cli (start server first)
&
CLI Tools
Viator includes a complete suite of command-line utilities:
viator
The main server binary.
viator-cli
Interactive command-line client (viator-cli compatible).
# Connect to server
# Execute single command
# With authentication
viator-benchmark
Performance benchmarking tool (viator-benchmark compatible).
# Run default benchmarks
# Custom benchmark
# With pipelining
viator-check-vdb
VDB (snapshot) file integrity checker.
# Check VDB file integrity
# Verbose output
viator-check-aof
AOF (append-only file) integrity checker and repair tool.
# Check AOF file
# Attempt to fix corrupted AOF
viator-sentinel
High availability monitoring daemon.
# Monitor a master
# With down-after threshold
Compatibility
Viator targets Redis 8.4.0 protocol compatibility:
| Feature | Status | Details |
|---|---|---|
| RESP3 Protocol | ✅ Full | All frame types, streaming |
| Core Commands | ✅ 200+ | String, List, Hash, Set, ZSet, Stream |
| VectorSet | ✅ Full | HNSW similarity search, persistence |
| Cluster Mode | ✅ Full | Gossip, failover, Redis 8.4 migration |
| Sentinel | ✅ Full | Monitoring, automatic failover |
| Lua Scripting | ✅ Full | Lua 5.4, real SHA1, sandboxed |
| Pub/Sub | ✅ Full | Channels, patterns, sharded |
| Transactions | ✅ Full | MULTI/EXEC, WATCH/UNWATCH |
| VDB Persistence | ✅ Full | CRC64 checksums, LZF decompression |
| AOF Persistence | ✅ Full | Atomic rewrite, fsync policies |
| Redis Stack | ✅ Full | JSON, TimeSeries, Bloom, Cuckoo, TopK, T-Digest, CMS |
| Security | ✅ Full | ACL, TLS 1.3, AUTH rate limiting |
Known Limitations
| Feature | Status | Details |
|---|---|---|
| Stream Persistence | ⚠️ Not Yet | Stream data is not persisted to AOF/VDB. Stream keys will be lost on restart. |
| CPU Metrics | ⚠️ Basic | INFO CPU section shows placeholder values |
Note: Stream commands (XADD, XREAD, XRANGE, etc.) work correctly in-memory. Only persistence is affected.
Project Structure
├── src/
│ ├── bin/ # CLI tool binaries
│ │ ├── viator-cli.rs # Command-line client
│ │ ├── viator-benchmark.rs # Performance benchmarking
│ │ ├── viator-check-vdb.rs # VDB file checker
│ │ ├── viator-check-aof.rs # AOF file checker
│ │ └── viator-sentinel.rs # HA monitoring daemon
│ ├── commands/ # Command implementations (200+ commands)
│ ├── protocol/ # RESP3 parser and frame handling
│ ├── server/ # TCP server, connections, cluster, sentinel
│ ├── storage/ # Database, expiry management
│ ├── persistence/ # AOF and VDB persistence (CRC64, LZF)
│ ├── security/ # ACL, TLS, audit, rate limiting
│ ├── types/ # Data type implementations (VectorSet, etc.)
│ ├── pool.rs # Buffer pooling
│ ├── error.rs # Error types
│ ├── main.rs # Server entry point (viator binary)
│ └── lib.rs # Library root
├── docs/
│ ├── ARCHITECTURE.md # System design overview
│ ├── PERSISTENCE.md # VDB/AOF documentation
│ ├── SECURITY.md # Security features
│ └── VECTORSET.md # Vector similarity search
├── fuzz/ # Fuzz testing targets
├── benches/ # Performance benchmarks
└── tests/ # Integration tests
License
MIT License - see LICENSE for details.
Acknowledgments
- Redis Ltd. for creating Redis and the RESP protocol specification. Redis is a registered trademark of Redis Ltd.
- The Rust community for excellent async and systems libraries
- tokio, dashmap, bytes, and other crate authors