DEV Community

pickuma
pickuma

Posted on • Originally published at pickuma.com

Dragonfly vs Redis in 2026: Is It Really a Faster Drop-In Cache?

Dragonfly markets itself with one line that gets engineers to pay attention: a drop-in Redis replacement that scales vertically on a single machine. You point your existing client at it, keep your GET/SET/HSET code untouched, and get more throughput per box because it uses every core instead of one.

That pitch is mostly accurate, and that's exactly why it deserves a careful read rather than a benchmark screenshot. "Drop-in" and "faster" are doing a lot of work in that sentence, and whether either holds depends on what your cache actually does. Here's how the two compare in 2026, and how to decide if a migration is worth your weekend.

What "drop-in" actually means

Dragonfly implements the RESP wire protocol, so the same redis-cli, the same ioredis or redis-py client, and the same connection string work without code changes. It also speaks the Memcached text protocol. For the common path — strings, hashes, lists, sorted sets, expirations, pub/sub — you genuinely can swap the endpoint and move on.

The gap shows up at the edges. Redis has a deep surface area: Lua scripting semantics, the module ecosystem (RediSearch, RedisJSON, RedisBloom, RedisTimeSeries), cluster-mode hash-slot behavior, and a long tail of less-common commands. Dragonfly covers a large fraction of the core command set and has added scripting and some search capabilities, but it is not a byte-for-byte clone. If your application leans on a specific Redis module or depends on exact WAIT/replication or cluster semantics, "drop-in" stops being literal.

Before you migrate anything, grep your codebase and your dependencies for the actual commands and modules you use. A cache that calls SET, GET, INCR, and EXPIRE will move cleanly. One that depends on RediSearch indexes or a custom Lua script with edge-case behavior needs a real compatibility test against your workload — not the vendor's feature matrix.

Where the architectures diverge

The reason Dragonfly can claim more throughput on one node comes down to threading. Redis executes commands on a single thread. That design is deliberate — it makes operations atomic without locks and keeps reasoning simple — and Redis added I/O threads in 6.0 to parallelize socket reads and writes. But command execution itself stays on one core. To use a 32-core machine fully with Redis, the standard answer is to run multiple instances or a cluster and shard across them.

Dragonfly takes the opposite stance. It uses a shared-nothing, multi-threaded architecture: the keyspace is partitioned across threads, each thread owns its slice, and there's no shared lock on the hot path. On a large multi-core box, that lets a single Dragonfly process saturate cores that a single Redis process leaves idle. It also ships a different hash table implementation (Dash) tuned for memory efficiency and incremental resizing, which reduces the latency spikes that classic open-addressing tables can cause during rehashing.

Snapshotting is the other meaningful difference. Redis BGSAVE forks the process, and on a write-heavy instance copy-on-write can balloon memory during the snapshot. Dragonfly performs point-in-time snapshots without a full fork, which avoids that memory spike and makes persistence on large datasets less of a tightrope walk.

A word on the throughput numbers you'll see. Dragonfly's team publishes benchmarks showing large multiples over a single Redis instance on high-core machines. Those are real measurements, but they compare one Dragonfly process against one Redis process — and one Redis process was never meant to use 32 cores. The honest comparison is Dragonfly versus a sharded Redis or Valkey cluster on the same hardware, and against that baseline the gap narrows. The win Dragonfly offers is less "Redis is slow" and more "you can collapse a cluster into a single node and cut operational complexity."

The license angle, because it changed

Licensing is part of this decision now in a way it wasn't a few years ago. Redis moved off the BSD license in March 2024 to a dual RSALv2/SSPLv1 model, which prompted the Valkey fork under the Linux Foundation, backed by AWS, Google, and Oracle and kept BSD-licensed. Redis 8 in 2025 re-added an AGPLv3 option. Dragonfly ships under the Business Source License 1.1 — source-available, with a use restriction against offering it as a competing managed service, converting to Apache 2.0 after a set period.

None of these is the plain BSD that Redis users assumed for a decade. If your legal or procurement team cares about OSI-approved open source specifically, Valkey is the cleanest path, and that's a separate conversation from raw performance. Pick your axis before you pick your datastore.

If your only goal is to fully use a large instance and you want a BSD license, benchmark Valkey before Dragonfly. It's the closest thing to "old Redis," it's adding its own multi-threading work, and it sidesteps both the BSL restriction and the module-compatibility question.

When to switch — and when not to

Dragonfly is a strong fit when you're running a large single cache instance, you're CPU-bound rather than memory-bound, and your command usage stays inside the core set. Collapsing a six-node Redis cluster into one Dragonfly box is a genuine operational simplification: fewer moving parts, no client-side sharding logic, simpler failover.

It's the wrong move when you depend on Redis modules, when you have battle-tested Lua scripts with subtle behavior, or when your cache is small enough that a single Redis thread already keeps up — which describes a large share of real workloads. A cache serving a few thousand operations per second on a 2-core container gains nothing from 32-way threading. Don't migrate for a benchmark you'll never hit.

The right way to decide is empirical: stand Dragonfly up beside your current cache, replay production-shaped traffic, and measure p99 latency and throughput on your hardware with your command mix. The vendor's numbers tell you what's possible; only your replay tells you what you'll get.


Originally published at pickuma.com. Subscribe to the RSS or follow @pickuma.bsky.social for new reviews.

Top comments (0)