finds.dev← search

// the find

tokio-rs/mini-redis

★ 4,710 · Rust · MIT · updated Apr 2026

Incomplete Redis client and server implementation using Tokio - for learning purposes only

mini-redis is a deliberately incomplete Redis implementation built on Tokio, maintained by the Tokio team themselves. It exists specifically to teach async Rust patterns — TCP server, framing, pub/sub, graceful shutdown, shared state — in a realistic but bounded context. Not for production use; treat it as an annotated textbook, not a library.

The code is written by the Tokio maintainers, so the patterns here are genuinely idiomatic, not cargo-culted. The choice to use std::sync::Mutex instead of tokio::sync::Mutex for the shared DB is correctly motivated and explained — that's a nuance most Tokio tutorials get wrong. Mocked time in tests using Tokio's test utilities is a pattern worth stealing directly. The pub/sub implementation using broadcast channels per channel plus StreamMap per connection is a clean, non-trivial design that maps well to real problems.

Only five commands (GET, SET, PING, PUBLISH, SUBSCRIBE) — enough to learn from, not enough to actually replace Redis even in a test environment if you need anything else. No persistence, no clustering, no AUTH, no pipelining — these aren't oversights, they're intentional, but means you can't use this as a drop-in for integration tests. The OTel integration is tacked on as a feature flag with an AWS-specific example, which dates it and limits its portability as a teaching tool. Comments are extensive in some files and sparse in others — the learning experience is uneven depending on which file you're reading.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →