# ๐ฅ 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.
[](https://www.rust-lang.org)
[](./LICENSE)
## โจ Features
- ๐ **High Performance**: Built with Rust for maximum speed and safety
- ๐ **Redis Protocol Compatible**: Drop-in replacement for Redis clients
- ๐งต **Async I/O**: Non-blocking networking with mio for high concurrency
- ๐พ **AOF Persistence**: Append-only file for data durability
- ๐ฏ **Zero Dependencies**: Minimal external dependencies for security
- ๐ **Built-in Benchmarks**: Performance testing included
## ๐๏ธ Architecture
Ignix uses a simple but efficient architecture:
- **RESP Protocol**: Full Redis Serialization Protocol support
- **Event-Driven Networking**: mio-based async I/O for handling thousands of connections
- **In-Memory Storage**: SwissTable-based hash map storage for optimal performance
- **AOF Persistence**: Optional append-only file logging for durability
## ๐ Quick Start
### Prerequisites
- Rust 1.80+ (recommended: latest stable)
- Cargo package manager
### Installation
```bash
git clone https://github.com/CycleChain/ignix.git
cd ignix
cargo build --release
```
### Running the Server
```bash
cargo run --release
```
The server will start on `0.0.0.0:7379` by default.
### Testing with Client Example
```bash
# In another terminal
cargo run --example client
```
Expected output:
```
+OK
$5
world
```
## ๐ก Supported Commands
Ignix supports the following Redis commands:
| `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
```bash
cargo test
```
### Run Benchmarks
```bash
# Execute benchmark
cargo bench --bench exec
# RESP parsing benchmark
cargo bench --bench resp
```
### Example Benchmark Results
```
exec/set_get time: [396.62 ยตs 403.23 ยตs 413.05 ยตs]
resp/parse_many_1k time: [296.51 ยตs 298.00 ยตs 299.44 ยตs]
```
## ๐ Client Usage
### Using Redis CLI
```bash
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"
```
### Using Any Redis Client Library
Ignix is compatible with any Redis client library. Here's a Python example:
```python
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: world
```
## ๐ Performance
> Benchmarks reflect Ignix v0.2.0 (reactor/worker split + DashMap). See `benchmark_results/benchmark_results.json` for full data.


### Highlights (from latest results)
- **SET 64B (10 conns)**: Ignix 21.5k ops/s vs Redis 17.6k โ **~1.22x**
- **SET 256B (10 conns)**: Ignix 28.0k vs 17.9k โ **~1.57x**
- **SET 4KB (10 conns)**: Ignix 28.1k vs 17.2k โ **~1.63x**
- **GET 64B (10 conns)**: Ignix 28.9k vs 16.8k โ **~1.72x**
- **GET 4KB (50 conns)**: Ignix 16.4k vs 13.0k โ **~1.25x**
Latency remains sub-millisecond across small and medium payloads in both systems, with Ignix sustaining higher throughput under concurrency.
### What changed in v0.2.0?
- **Reactor decoupled** from storage/disk via worker pool + `mio::Waker` โ no blocking on hot path.
- **DashMap storage** with sharded locking โ significantly less contention under writes.
- **Bounded channels** (tasks/AOF) โ backpressure and better stability under load.
### ๐ Benchmark Your Own Workload
Run comprehensive benchmarks with our included tools:
```bash
# 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 25
```
**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
> **๐ง Early Development Stage**: Ignix is actively under development. APIs may change, and new features are being added regularly. We welcome contributions and feedback!
### 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
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Add tests for new functionality
5. Run tests (`cargo test`)
6. Run benchmarks (`cargo bench`)
7. Commit your changes (`git commit -m 'Add amazing feature'`)
8. Push to the branch (`git push origin feature/amazing-feature`)
9. 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
```bash
RUST_LOG=debug cargo run --release
```
### Monitor AOF File
```bash
tail -f ignix.aof
```
## ๐ง Roadmap
**Current Development Phase**: Core optimization and stability
### ๐ฏ Short Term (Next Release)
- [ ] **Performance optimization** for large data operations
- [ ] **Memory management** improvements
- [ ] **Connection pooling** enhancements
- [ ] **Comprehensive benchmarking** suite expansion
### ๐ Medium Term
- [ ] **More Redis commands** (HASH, LIST, SET operations)
- [ ] **Multi-threading** support for better concurrency
- [ ] **RDB snapshots** for faster restarts
- [ ] **Metrics and monitoring** endpoints
### ๐ Long Term Vision
- [ ] **Clustering support** for horizontal scaling
- [ ] **Replication** for high availability
- [ ] **Lua scripting support** for complex operations
- [ ] **Advanced data structures** and algorithms
- [ ] **Plugin architecture** for extensibility
> **๐ Performance Goals**: Our primary focus is achieving consistently high performance across all data sizes while maintaining the simplicity and reliability that makes Ignix special.
## ๐ Known Limitations
> **Development Status**: These limitations are actively being addressed as part of our development roadmap.
### Current Limitations
- **Single-threaded execution** (one shard) - *Multi-threading planned*
- **Limited command set** compared to full Redis - *Expanding gradually*
- **Large data performance** can be slower than Redis - *Optimization in progress*
- **No clustering or replication** yet - *Future releases*
- **AOF-only persistence** (no RDB snapshots) - *RDB support planned*
### Performance Notes
- **Excellent for small data** (64 bytes): Up to 4x faster SET operations than Redis
- **Competitive for medium data** (256 bytes - 1KB): Similar to Redis performance
- **Room for improvement** on large payloads (4KB+): Redis shows maturity in large data handling
These characteristics make Ignix ideal for:
- โ
**Caching layers** with small objects
- โ
**Session storage** with quick access patterns
- โ
**Real-time applications** requiring low latency
- โ
**Microservices** with high-frequency, small data operations
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- [Redis](https://redis.io/) for the protocol specification
- [mio](https://github.com/tokio-rs/mio) for async I/O
- The Rust community for excellent tooling and libraries
## ๐ Support
- **Issues**: [GitHub Issues](https://github.com/CycleChain/ignix/issues)
- **Discussions**: [GitHub Discussions](https://github.com/CycleChain/ignix/discussions)
---
**Built with โค๏ธ and ๐ฆ by the [CycleChain.io](https://cyclechain.io) team**