#redis #multiplexing #async

muxis

High-performance Redis client for Rust with multiplexing

3 releases (breaking)

0.5.0 Feb 6, 2026
0.4.0 Feb 5, 2026
0.3.0 Feb 5, 2026

#1079 in Database interfaces

MIT/Apache

265KB
5K SLoC

Muxis

High-performance async Redis client for Rust with multiplexing and cluster support.

Crates.io Documentation License

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:

[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?;

Documentation

Feature Flags

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

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
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 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:

cargo bench --features cluster

Testing

Run 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 -- --ignored

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:

at your option.

Resources

Acknowledgments

Muxis is inspired by mini-redis and built with:

Dependencies

~10–26MB
~256K SLoC