DEV Community

Alex Spinov
Alex Spinov

Posted on

Dragonfly Has a Free Drop-In Redis Replacement

Dragonfly is a free, open-source in-memory data store that is a drop-in replacement for Redis — but 25x faster and uses 80% less memory.

What Is Dragonfly?

Dragonfly is a modern in-memory cache built from scratch in C++. It is compatible with the Redis and Memcached APIs but dramatically more efficient.

Key features:

  • 25x faster throughput than Redis
  • 80% less memory usage
  • Redis API compatible (drop-in replacement)
  • Memcached API compatible
  • Multi-threaded (uses all CPU cores)
  • Snapshotting without forks
  • Single binary

Quick Start

docker run -d --name dragonfly -p 6379:6379 docker.dragonflydb.io/dragonflydb/dragonfly
Enter fullscreen mode Exit fullscreen mode

Now use any Redis client:

redis-cli -p 6379
SET hello world
GET hello
Enter fullscreen mode Exit fullscreen mode

Drop-In Replacement

import redis
r = redis.Redis(host="localhost", port=6379)
r.set("key", "value")
print(r.get("key"))  # Works exactly like Redis
Enter fullscreen mode Exit fullscreen mode

No code changes needed. Just swap Redis for Dragonfly.

Dragonfly vs Redis

Feature Redis Dragonfly
Threads Single Multi-threaded
Memory efficiency Baseline 80% less
Throughput (1 instance) 100K ops/sec 2.5M ops/sec
Snapshots Fork (doubles RAM) No fork
Clustering needed For scale Rarely

With 28K+ GitHub stars. Redis, but better.


Cache your scraped data! Apify tools. Custom solutions: spinov001@gmail.com

Top comments (0)