rueidis recycles every built command unless you pin it, and its whole dependency list is two packages
A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, RDMA, etc.
At a glance
- What is it?
- rueidis is the Redis organisation's Go client, built around automatic pipelining and server-assisted caching with a command builder that allocates nothing. The design has one sharp edge that the README shouts about, and the module manifest has a second that it does not: a client with RDMA ambitions whose entire direct dependency list is a system library and a test matcher.
- Who is it for?
- rueidis fits a Go service that issues many small Redis commands concurrently and can measure the result, since the pipelining and caching paths are where its advantages live. Read the recycling rule before your first loop, because the natural way to write code against it is the wrong way and the failure is silent.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- redis/rueidis2,997 ★ · +14
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| redis/rueidis | 3k | 3k |
14 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Built commands go back to a pool, so reusing one is a bug
The most important sentence in the file is set apart from the prose and marked with emphasis on both sides. It says you should not reuse a command in another call, because by default it has been recycled to an underlying object pool. That is the price of the allocation-free design: a built command is not a value you own, it is a loan from a pool, and passing it twice hands the same object to two callers. The escape is a pin call after the build step, which prevents the recycling. The same rule comes back in the pipelining section, where the file repeats that original commands are recycled after execution and that if you need to reference them afterwards, for instance to retrieve the key, you should pin them. The example that follows shows how far that goes: it recovers the key by indexing into the built command's own byte slice and taking the second element, which is reading the wire format rather than any Go field. The batch form shows the same rule in a loop:
// Create pinned commands to preserve them from being recycled
cmds := make(rueidis.Commands, 0, 10)
for i := 0; i < 10; i++ {
cmds = append(cmds, client.B().Get().Key(strconv.Itoa(i)).Build().Pin())
}
// Execute commands and process responses
for i, resp := range client.DoMulti(context.Background(), cmds...) {
fmt.Println(resp.ToString()) // this is the result
fmt.Println(cmds[i].Commands()[1]) // this is the corresponding key
}Pinning costs an allocation per command, which is precisely the trade the design is built to avoid, so the rule is effectively that any command you keep a reference to is a command you have opted out of the fast path for.
A client with RDMA in its description and two dependencies
The module targets a recent language version and its manifest is unusually short. There are two direct requirements. One is the system-level platform package, which is unremarkable. The other is a matcher library, the kind that belongs in a test suite, appearing as a direct requirement of the published module rather than as a test-only one. Four more packages appear as indirect, giving five in total, one of which is the successor home for a well-known YAML package. So the dependency surface is close to zero, which is a genuine achievement for a client and also a signal about what is and is not here: the repository description advertises RDMA support among its features, and neither the manifest nor the readable part of the README mentions remote direct memory access at all. There is no networking dependency to implement it with. Either the description overstates the project or the feature lives outside the visible files.
Nil responses are cached and the behaviour is filed as an open issue
The caching layer is described as opt-in but enabled by default, which is a phrase worth pausing on. You opt into it per call, by using the caching variants of the two send methods and giving each call a client-side lifetime, with a small constructor helper for the lifetime argument. Then the detail that matters: cached responses, and the file says this explicitly, include nil replies. A key that does not exist therefore gets a cached negative result for its whole lifetime, and a key created inside that window is invisible to a cached read. The file states the invalidation rules, which are a server notification or expiry of the client-side lifetime, and then points at an issue number for the details rather than resolving them. The section compares the effect to running a replica inside your own application, and its benchmark link stops partway through the address.
Auto pipelining is on by default and the escape hatch is per command
Every concurrent non-blocking command is pipelined automatically with no configuration, and the stated benefit is fewer round trips and fewer system calls. You get it by calling the send method from several goroutines, and the benchmark example does exactly that with a parallel test helper. The escape is a single option set to true, which switches to a connection pool where each request gets a dedicated connection and is served on the calling goroutine. The file is candid about why you might want that: the automatic mode relies on extra goroutines to match requests to responses, which can add latency through goroutine scheduling and head-of-line blocking. And the switch is not absolute, because a command can still be marked for the automatic path explicitly and sent through the normal method, so you can run pooled connections by default and pipeline a chosen subset.
The headline figure is 14x and the comparison around it has no numbers
The comparison against the incumbent Go client opens with a claim rather than a measurement: higher throughput across three parallelism settings of one, eight and sixty-four, with no figures attached to any of them. The one number in the section is bolder and narrower. It claims up to roughly fourteen times the throughput of that client in a local benchmark, and it names the hardware, a specific laptop model, and then gives the benchmark setting in parentheses so a reader can reproduce exactly that cell. It is good practice and it is attached to a single data point. The benchmark source is linked, and the link points at a repository under a differently spelled owner than the one hosting the client. A second result on two cloud machines is offered as a pull request rather than as a table.
The test matrix runs the same image under four service names
The compose file for the test suite is a compatibility matrix, and it covers far more than Redis: a Redis-compatible key-value store, an in-memory store, a RocksDB-backed store, a search module image, two Redis Stack images, and three plain Redis lines at different major versions. What makes it readable is the port-per-service layout, with each engine given its own host port. What makes it odd is the duplication: two services use the identical current image under different names, two more use the identical older image, and two use the identical Stack image. The Sentinel fixtures run a single master with a quorum of two, which only makes sense once a test promotes a second master. Unlike a typical deployment compose file, this one has no health checks at all.
Tests sit beside sources and the main file's test has a different name
The repository is flat at the top level, and the convention is unmistakable: nearly every source file has a test file of the same name next to it, covering the client, the cluster client, the ring, the pool, the pipeline, the pubsub layer, the protocol encoder and decoder, the retry logic, the cache, the multiplexer, the Lua helper, the binary reader, the message types, the flow buffer and the least-recently-used cache. There is no separate test directory. The convention breaks in exactly one place, and it is the main library file, whose test is named after Redis rather than after the library, so the pair that matters most for reading the code is the one pair whose names do not match. A shell script for running the suite against the compose file sits at the root beside it, along with a directory of build tooling.
The feature list is a directory map with two links to directories that are not listed
Most of the feature bullets are not sentences; they are links to subpackages. Generic object mapping, a cache-aside helper, distributed locks, a mock for tests, tracing integration, hooks, a compatibility adapter, probabilistic data structures, and the main caching section all point at a directory rather than describing behaviour. Two details follow from that shape. The adapter that mimics the incumbent Go client's API is credited to an outside contributor rather than maintained here, so the migration path away from the other client is somebody else's project. And comparing the two lists, a rate limiter and a mock companion for the compatibility adapter appear at the top level of the repository without being mentioned in the feature list, while the tracing and probabilistic-structure directories the list links to are not present there. The headings are an index of the source tree more than a specification.
Editorial conclusion
rueidis fits a Go service that issues many small Redis commands concurrently and can measure the result, since the pipelining and caching paths are where its advantages live. Read the recycling rule before your first loop, because the natural way to write code against it is the wrong way and the failure is silent. Turn auto pipelining off and measure if you care about tail latency rather than throughput, since the file says it trades one for the other. And check the caching behaviour on nil responses before you rely on it, because that case is documented as an open issue rather than as settled behaviour.
Frequently asked questions
What is rueidis used for?
It is the Redis organisation's Go client for Redis and Redis-compatible servers, built around automatic pipelining of concurrent commands and server-assisted client-side caching. It supports cluster and sentinel topologies, the usual Redis data structures and modules, pub/sub and streams, and sharded pub/sub.
Why does rueidis recycle my commands?
Built commands are returned to an internal object pool after execution, which is what keeps allocations out of the hot path. The file marks this with emphasis and says you should not reuse a command in another send call, and that pinning it after building prevents the recycling.
Does rueidis cache values that do not exist?
Yes. The file states that cached responses include nil replies, so a missing key is cached for its client-side lifetime. Invalidation happens on a server notification or when that lifetime expires, and the behaviour is pointed at an open issue for further detail.
How do I turn off rueidis auto pipelining?
Set the disable option to true, which switches to a connection pool serving each request on a dedicated connection and the calling goroutine. The file says this is worth doing when latency matters more than throughput, and that you can still mark individual commands for the automatic path.
What are rueidis's dependencies?
Two direct ones: a system platform package and a matcher library, with four more indirect. The module targets a recent Go language version. The repository description also mentions remote direct memory access, which appears in neither the manifest nor the readable documentation.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/redis-rueidis)Star history chart for your README
[](https://hysenlabs.com/projects/redis-rueidis)Was this useful?