๐ฅ Ignix
High-Performance Redis-Compatible Key-Value Store
Ignix (from "Ignite" + "Index") is a blazing-fast, Redis-protocol compatible key-value store designed for modern multi-core systems. Built with Rust for maximum performance and safety.
โจ Features
- ๐ High Performance: Rust + reactor/worker model for parallel execution
- ๐ Redis Protocol Compatible: Drop-in replacement for Redis clients
- ๐งต Async I/O (mio): Non-blocking reactor +
mio::Wakerresponse path - ๐พ AOF Persistence: Background writer with bounded backpressure
- ๐ง Concurrent Storage:
DashMap(sharded locking) in hot path - ๐ Benchmarks Included: Scripts and criterion benches
๐๏ธ Architecture
Ignix v0.3.2 architecture:
- Multi-Reactor (Thread-per-Core): Uses
SO_REUSEPORTto spawn N independent worker threads (one per CPU core). - Pluggable Backend: Supports both
mio(epoll/kqueue) andio_uring(Linux only) backends. - Shared Nothing: Each thread has its own event loop and handles connections independently.
- Zero-Lock Networking: No shared listener lock; kernel distributes incoming connections.
- Zero-Copy Response: Responses are written directly to the network buffer, avoiding intermediate allocations.
- RESP Protocol: Full Redis Serialization Protocol support with optimized SWAR parsing.
- Concurrent Storage:
DashMap<Bytes, Value>(sharded locking) for high-concurrency data access. - AOF Persistence: Dedicated thread, bounded channel, periodic fsync.
๐ Quick Start
Prerequisites
- Rust 1.80+ (recommended: latest stable)
- Cargo package manager
Installation
Running the Server
# Or enable io_uring backend (Linux only)
The server will start on 0.0.0.0:7379 by default.
Testing with Client Example
# In another terminal
Expected output:
+OK
$5
world
๐ก Supported Commands
Ignix supports the following Redis commands:
| Command | Description | Example |
|---|---|---|
PING |
Test connectivity | PING โ +PONG |
SET |
Set key-value pair | SET key value โ +OK |
GET |
Get value by key | GET key โ $5\r\nvalue |
DEL |
Delete key | DEL key โ :1 |
EXISTS |
Check if key exists | EXISTS key โ :1 |
INCR |
Increment integer value | INCR counter โ :1 |
RENAME |
Rename a key | RENAME old new โ +OK |
MGET |
Get multiple values | MGET key1 key2 โ *2\r\n... |
MSET |
Set multiple key-value pairs | MSET k1 v1 k2 v2 โ +OK |
๐ง Configuration
Environment Variables
RUST_LOG: Set logging level (e.g.,debug,info,warn,error)
AOF Persistence
Ignix automatically creates an ignix.aof file for persistence. Data is written to AOF and flushed every second for durability.
๐งช Testing
Run Unit Tests
Run Benchmarks
# Execute benchmark
# RESP parsing benchmark
Example Benchmark Results
See the Performance section and benchmark_results/benchmark_results.json.
๐ Client Usage
Using Redis CLI
Using Any Redis Client Library
Ignix is compatible with any Redis client library. Here's a Python example:
# Connect to Ignix
=
# Use like Redis
# Output: world
๐ Performance
Benchmarks reflect Ignix v0.3.1. Full raw results are in benchmarks/results/.
SET Throughput (ops/sec)
| Data | Conns | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|---|
| 64B | 1 | 9,249 | 9,116 | 0.99x |
| 64B | 10 | 17,628 | 22,360 | 1.27x |
| 64B | 50 | 18,236 | 23,993 | 1.32x |
| 256B | 1 | 14,615 | 4,738 | 0.32x |
| 256B | 10 | 17,880 | 16,273 | 0.91x |
| 256B | 50 | 16,898 | 16,959 | 1.00x |
| 1KB | 1 | 16,300 | 6,451 | 0.40x |
| 1KB | 10 | 16,936 | 24,323 | 1.44x |
| 1KB | 50 | 3,313 | 7,314 | 2.21x |
| 4KB | 1 | 11,286 | 8,581 | 0.76x |
| 4KB | 10 | 17,232 | 27,933 | 1.62x |
| 4KB | 50 | 16,343 | 20,675 | 1.27x |
GET Throughput (ops/sec)
| Data | Conns | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|---|
| 64B | 50 | 35,235 | 42,495 | 1.21x |
| 1KB | 50 | 33,701 | 39,466 | 1.17x |
| 32KB | 20 | 15,912 | 21,445 | 1.35x |
| 256KB | 20 | 18,497 | 17,408 | 0.94x |
| 2MB | 10 | 1,054 | 2,062 | 1.96x |
Note: v0.3.1 introduced Zero-Copy Response Generation, significantly boosting GET performance. Ignix now consistently outperforms or matches Redis across most payload sizes.
Real-World Scenario (Session Store)
| Metric | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|
| Throughput | 3,201 ops/sec | 3,996 ops/sec | 1.25x |
| Avg Latency | 13.56 ms | 10.38 ms | 0.76x |
Notes:
- Values rounded from
benchmark_results/benchmark_results.json. - All runs showed 0 errors, 100% success.
๐ Benchmark Your Own Workload
Run comprehensive benchmarks with our included tools:
# Quick comparison
# Detailed analysis with charts
# Custom test scenarios
Architecture Benefits:
- Sub-millisecond latency for most operations
- High throughput with async I/O
- Memory efficient with zero-copy operations where possible
- Minimal allocations in hot paths
๐๏ธ Development
Project Structure
src/
โโโ bin/ignix.rs # Server binary
โโโ lib.rs # Library exports
โโโ protocol.rs # RESP protocol parser/encoder
โโโ storage.rs # In-memory storage (Dict)
โโโ shard.rs # Command execution logic
โโโ net.rs # Networking and event loop
โโโ aof.rs # AOF persistence
examples/
โโโ client.rs # Example client
tests/
โโโ basic.rs # Basic functionality tests
โโโ resp.rs # Protocol parsing tests
benches/
โโโ exec.rs # Command execution benchmarks
โโโ resp.rs # Protocol parsing benchmarks
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Run tests (
cargo test) - Run benchmarks (
cargo bench) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Style
- Follow Rust standard formatting (
cargo fmt) - Run Clippy lints (
cargo clippy) - Maintain test coverage for new features
๐ Debugging
Enable debug logging: RUST_LOG=debug cargo run --release
Monitor AOF: tail -f ignix.aof
๐ง Roadmap (Short)
- More Redis commands (HASH/LIST/SET)
- RDB snapshots, metrics/monitoring
- Clustering and replication
๐ Known Limitations
- Limited command set vs Redis (expanding)
- No clustering or replication yet
- RDB snapshots not yet available
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Redis for the protocol specification
- mio for async I/O
- The Rust community for excellent tooling and libraries
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with โค๏ธ and ๐ฆ by the CycleChain.io team