redis-rs

An idiomatic, high-level Redis and Valkey client for Rust with sync, async, and cluster support.

Library
Cargo
v1.7.1
4,257 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 96
Maintenance 96
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 84
Code Quality 85
Innovation 76
Learning Curve 68

redis-rs is a Rust library implementing a high-level client for Redis, Valkey, and any other RESP (Redis Serialization Protocol) compliant server. It exposes the full range of Redis functionality through a flexible, low-level command API paired with a customizable type-conversion trait, so commands can return results directly as the Rust type the caller expects rather than requiring manual parsing of raw replies.

The crate supports both synchronous and asynchronous (tokio/async-std) connections, connection pooling via r2d2/bb8, pub/sub, Redis Cluster and Sentinel topologies, TLS, and pipelining. It’s one of the most widely depended-upon Redis clients in the Rust ecosystem, published as the redis crate and consumed transitively by countless web services, caching layers, and job queues built in Rust.

What You Get

  • Synchronous and async (tokio, async-std) client connections to Redis/Valkey
  • A generic command API with a FromRedisValue/ToRedisArgs type-conversion system
  • Redis Cluster and Sentinel client support for high-availability deployments
  • Pub/sub support including an async subscription tracker
  • Pipelining and transaction (MULTI/EXEC) support
  • Optional integration with r2d2 and bb8 connection pools, plus TLS and cloud-auth (Entra ID) support

Common Use Cases

  • Caching layers for Rust web services (session storage, response caching, rate limiting)
  • Pub/sub messaging and event distribution between Rust services
  • Connecting to Redis Cluster or Sentinel deployments for high-availability production setups
  • Job/task queues backed by Redis lists or streams
  • Async data access in tokio-based Rust backends via the async connection API

Under The Hood

Architecture - The workspace root Cargo.toml defines a multi-crate layout with the primary redis crate under redis/, plus redis-test for test utilities and a valkey/ directory tracking Valkey-specific compatibility. Inside redis/src/, the client is split by concern: connection.rs and client.rs handle connection establishment, cmd.rs/pipeline.rs build and dispatch commands, parser.rs decodes RESP replies, types.rs defines the FromRedisValue/ToRedisArgs conversion traits, and dedicated modules (cluster_handling/, sentinel.rs, subscription_tracker.rs, aio/) layer cluster, sentinel, and async pub/sub support on top of the core connection primitives.

Tech Stack - Pure Rust, edition 2024, minimum Rust version 1.88 per redis/Cargo.toml. Core dependencies are intentionally minimal (ryu, itoa, percent-encoding for formatting/parsing), with heavier functionality — tokio/async-std runtimes, TLS backends, r2d2/bb8 pooling, and cluster support — gated behind Cargo feature flags so consumers only pay for what they use. An afl/ directory holds fuzz-testing harnesses for the RESP parser.

Code Quality - The redis/tests/ directory contains 27 integration test files covering cluster handling, TLS, pub/sub, scripting, and pooling integrations (r2d2.rs, bb8.rs), and a CODING_CONVENTIONS.md documents the project’s style expectations for contributors. Fuzz testing via afl on the parser indicates attention to protocol-parsing correctness, which matters given RESP is a binary-safe, hand-rolled protocol. CI runs via GitHub Actions with a badge showing build status against multiple Redis/Valkey versions.

API Design - The API centers on a Client/Connection pair and a cmd() builder for issuing arbitrary Redis commands, with results generically deserialized via the FromRedisValue trait — so .query::<String>() or .query::<HashMap<String, i32>>() both work against the same command without separate typed methods per command. This low-level-but-typed approach trades some discoverability (commands aren’t individually named methods for every Redis command) for flexibility across the full RESP command surface, including newer Redis/Valkey commands the crate hasn’t added a dedicated wrapper for yet.

Used by 13 apps in this directory

Rust
86%
Other

Arroyo

Analytics · Data Engineering

5,039

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust 86%
Updated 2 weeks ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 1 weeks ago
Svelte
44%
MIT

Cryptgeon

File Storage · Security

1,538

Self-destructing encrypted notes and files that vanish after viewing — the server never sees your keys.

View details
88
Repo Health
80
Technical
74
Dependency
Built with
Svelte 44%
TypeScript 39%
Rust 13%
Updated 1 weeks ago
Python
82%
Apache 2.0

headroom

AI Development · Developer Tools

73,966

Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.

View details
85
Repo Health
86
Technical
69
Dependency
Built with
Python 82%
Rust 12%
Updated 1 weeks ago
Rust
37%
Other

Hook0

Devops

1,491

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
82
Repo Health
82
Technical
69
Dependency
Built with
Rust 37%
TypeScript 12%
Updated 2 weeks ago
TypeScript
61%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,797

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 61%
Svelte 34%
Updated 1 weeks ago
Rust
73%
Other

iii

Developer Tools · Devops

18,814

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 73%
TypeScript 16%
Updated 1 weeks ago
TypeScript
64%
Apache 2.0

Laminar

AI Development · Monitoring

3,285

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 64%
Rust 34%
Updated 1 weeks ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers