Muxis
High-performance async Redis client for Rust with multiplexing and cluster support.
Features
- 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
Quick Start
Add Muxis to your Cargo.toml:
[]
= "0.4"
Basic usage:
use Client;
use Bytes;
async
Redis Cluster:
use ClusterClient;
let client = connect.await?;
client.set.await?;
Documentation
- 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
Feature Flags
Enable optional features in Cargo.toml:
[]
= { = "0.4", = ["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 |
Project Status
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.
Examples
The examples/ directory contains working examples:
# Basic usage
# Using ClientBuilder
# Pipeline execution
# Authentication
# Redis Cluster
Performance
Muxis 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:
Testing
Run tests:
# Unit tests (no Redis required)
# Integration tests (requires Redis)
# Cluster tests (requires Redis Cluster)
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
For AI coding agents, see AGENTS.md for development guidelines and commands.
Versioning
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
License
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.
Resources
- Documentation: https://docs.rs/muxis
- Repository: https://github.com/nghiaphamln/muxis
- Crates.io: https://crates.io/crates/muxis
- Roadmap: ROADMAP.md
- Changelog: CHANGELOG.md
Acknowledgments
Muxis is inspired by mini-redis and built with: