redis-rs

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

Library
Cargo
v1.6.0
4,245stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
92/100Excellent
Development Activity100
Maintenance96
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture84
Code Quality85
Innovation76
Learning Curve68

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 12 apps in this directory

Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

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
Rust86%
Updated 1 weeks ago
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

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

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Svelte
46%
MIT

Cryptgeon

File Storage · Security

1,506

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

View details
80
Repo Health
80
Technical
74
Dependency
Built with
Svelte46%
TypeScript30%
Rust14%
Updated 1 months ago
Python
80%
Apache 2.0

headroom

AI Development · Developer Tools

66,835

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
84
Repo Health
86
Technical
73
Dependency
Built with
Python80%
Rust14%
Updated today
Rust
41%
Other

Hook0

Devops

1,477

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
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,384

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
64
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
Rust
72%
Other

iii

Developer Tools · Devops

18,604

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

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

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
70
Dependency
Built with
TypeScript69%
Rust29%
Updated yesterday
Python
74%
AGPL 3.0

OpenViking

Databases · AI Development

29,711

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

View details
84
Repo Health
75
Technical
65
Dependency
Built with
Python74%
Rust14%
Updated today

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

Search