High-performance async Redis client for Rust with multiplexing and cluster support.
- Async/Await: Built on Tokio for high-performance async I/O
- Multiplexing: Multiple concurrent requests over single connection
- Cluster Support: Production-grade Redis Cluster with automatic routing and failover
- RESP Protocol: Full RESP2 support with RESP3 coming soon
- Type Safety: Strongly-typed API with comprehensive error handling
- Zero-Copy: Efficient parsing using
bytes::Bytes - 75+ Commands: String, Hash, List, Set, Sorted Set operations
Add Muxis to your Cargo.toml:
[dependencies]
muxis = "0.4"Basic usage:
use muxis::Client;
use bytes::Bytes;
#[tokio::main]
async fn main() -> muxis::Result<()> {
let mut client = Client::connect("redis://127.0.0.1:6379").await?;
client.set("mykey", Bytes::from("Hello, Muxis!")).await?;
if let Some(value) = client.get("mykey").await? {
println!("Value: {}", String::from_utf8_lossy(&value));
}
Ok(())
}Redis Cluster:
use muxis::ClusterClient;
let client = ClusterClient::connect("127.0.0.1:7000,127.0.0.1:7001").await?;
client.set("key", Bytes::from("value")).await?;- Getting Started - Installation, basic usage, connection URLs
- Commands Reference - Complete command documentation
- Cluster Mode - Redis Cluster support, topology, failover
- Multiplexing - How concurrent requests work
- Architecture - Internal design and implementation
Enable optional features in Cargo.toml:
[dependencies]
muxis = { version = "0.4", features = ["cluster", "tls"] }Available features:
| Feature | Description |
|---|---|
cluster |
Redis Cluster support with slot routing |
tls |
TLS/SSL encrypted connections |
resp3 |
RESP3 protocol support (experimental) |
json |
JSON serialization helpers |
streams |
Redis Streams support |
test-utils |
Testing utilities for integration tests |
Current Version: 0.4.0
Completed Features:
- RESP2 protocol codec
- Multiplexed connections
- 75+ Redis commands
- Connection pooling
- Redis Cluster with resilience (MOVED/ASK handling, failure detection, automatic retry)
- Comprehensive documentation
In Development (Roadmap):
- Pipelining API
- Pub/Sub support
- Transactions (MULTI/EXEC)
- Lua scripting
- RESP3 protocol
- Sentinel support
See ROADMAP.md for detailed development plan.
The examples/ directory contains working examples:
# Basic usage
cargo run --example basic
# Using ClientBuilder
cargo run --example builder
# Pipeline execution
cargo run --example pipeline
# Authentication
cargo run --example auth
# Redis Cluster
cargo run --example cluster --features clusterMuxis is designed for high performance:
- Multiplexing: Share single connection across many concurrent requests
- Zero-copy: Efficient buffer management with
bytes::Bytes - Connection pooling: Reuse connections in cluster mode
- Smart routing: Direct routing to correct cluster node
Benchmarks available in benches/ directory:
cargo bench --features clusterRun tests:
# Unit tests (no Redis required)
cargo test --lib --all-features
# Integration tests (requires Redis)
cargo test --test integration -- --ignored
# Cluster tests (requires Redis Cluster)
cargo test --test cluster_integration -- --ignoredContributions are welcome! Please see CONTRIBUTING.md for guidelines.
For AI coding agents, see AGENTS.md for development guidelines and commands.
Muxis follows Semantic Versioning 2.0.
Current version 0.4.0 indicates:
- Public API is not yet stable (breaking changes may occur)
- Production-ready for internal use
- Approaching 1.0.0 with feature completion
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
- Documentation: https://docs.rs/muxis
- Repository: https://github.com/nghiaphamln/muxis
- Crates.io: https://crates.io/crates/muxis
- Roadmap: ROADMAP.md
- Changelog: CHANGELOG.md
Muxis is inspired by mini-redis and built with: