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.
- π 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
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.
- Rust 1.80+ (recommended: latest stable)
- Cargo package manager
git clone https://github.com/CycleChain/ignix.git
cd ignix
cargo build --releasecargo run --release
# Or enable io_uring backend (Linux only)
cargo run --release -- --backend=uringThe server will start on 0.0.0.0:7379 by default.
# In another terminal
cargo run --example clientExpected output:
+OK
$5
world
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 |
RUST_LOG: Set logging level (e.g.,debug,info,warn,error)
Ignix automatically creates an ignix.aof file for persistence. Data is written to AOF and flushed every second for durability.
cargo test# Execute benchmark
cargo bench --bench exec
# RESP parsing benchmark
cargo bench --bench respSee the Performance section and benchmark_results/benchmark_results.json.
redis-cli -h 127.0.0.1 -p 7379
127.0.0.1:7379> PING
PONG
127.0.0.1:7379> SET hello world
OK
127.0.0.1:7379> GET hello
"world"Ignix is compatible with any Redis client library. Here's a Python example:
import redis
# Connect to Ignix
r = redis.Redis(host='localhost', port=7379, decode_responses=True)
# Use like Redis
r.set('hello', 'world')
print(r.get('hello')) # Output: worldBenchmarks reflect Ignix v0.3.1. Full raw results are in benchmarks/results/.
| Data | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|
| 64B | 7,577 | 17,812 | 2.35x |
| 1KB | 9,018 | 23,077 | 2.56x |
| 32KB | 4,330 | 15,862 | 3.66x |
| 256KB | 961 | 3,347 | 3.48x |
| 2MB | 343 | 277 | 0.81x |
| Data | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|
| 64B | 9,868 | 29,317 | 2.97x |
| 1KB | 2,040 | 20,712 | 10.16x |
| 32KB | 8,183 | 13,055 | 1.60x |
| 256KB | 4,017 | 11,266 | 2.80x |
| 2MB | 407 | 1,080 | 2.65x |
Note: v0.3.1 introduced Zero-Copy Response Generation, significantly boosting GET performance. Ignix now consistently outperforms or matches Redis across most payload sizes.
| Metric | Redis | Ignix | Ratio (Ignix/Redis) |
|---|---|---|---|
| Throughput | 20,507 ops/sec | 23,899 ops/sec | 1.17x |
| Avg Latency | 1.93 ms | 1.61 ms | 0.83x |
Notes:
- Values rounded from
benchmark_results/benchmark_results.json. - All runs showed 0 errors, 100% success.
Run comprehensive benchmarks with our included tools:
# Quick comparison
python3 quick_benchmark.py
# Detailed analysis with charts
python3 benchmark_redis_vs_ignix.py
# Custom test scenarios
python3 benchmark_redis_vs_ignix.py --data-sizes 64 256 1024 --connections 1 10 25Architecture 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
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
- 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
- Follow Rust standard formatting (
cargo fmt) - Run Clippy lints (
cargo clippy) - Maintain test coverage for new features
Enable debug logging: RUST_LOG=debug cargo run --release
Monitor AOF: tail -f ignix.aof
- More Redis commands (HASH/LIST/SET)
- RDB snapshots, metrics/monitoring
- Clustering and replication
- Limited command set vs Redis (expanding)
- No clustering or replication yet
- RDB snapshots not yet available
This project is licensed under the MIT License - see the LICENSE file for details.
- Redis for the protocol specification
- mio for async I/O
- The Rust community for excellent tooling and libraries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ and π¦ by the CycleChain.io team