A Redis- and Valkey-compatible in-memory key-value server written in Rust, with built-in full-text and vector search.
dragonflydb/dragonfly
An in-memory data store that is API-compatible with Redis and Memcached, aiming to be a drop-in replacement for both.
Open-source alternative to:Redis
- Stars
- 31,798
- Forks
- 1,283
- Open issues
- 276
- Last commit
- 5 hours ago
What is it?
Dragonfly is an in-memory data store that implements the Redis and Memcached protocols, so existing clients and applications can connect without code changes. It is written in C++ and uses a shared-nothing architecture that partitions the keyspace across threads, letting one instance use multiple CPU cores instead of the single thread that a Redis process typically relies on.
The project covers caching and key-value workloads, with an adaptive cache eviction mode enabled by a flag, TTL-based expiration, and a snapshotting mechanism for backups. Snapshots can be scheduled with a cron expression. Dragonfly also exposes Prometheus-compatible metrics and a built-in HTTP console on its main port, which can be disabled for deployments exposed to untrusted networks.
The README reports benchmark comparisons against Redis and Memcached on AWS instances, with throughput and latency figures varying by instance size and workload. Those numbers come from the project's own tests, so they are best verified against your own workload.
Key features
- 01Compatible with Redis and Memcached protocols, so existing clients work without code changes.
- 02Multi-threaded design that partitions keys across threads to use multiple CPU cores.
- 03Adaptive cache eviction mode that evicts items when nearing the memory limit.
- 04Scheduled snapshots using cron syntax, plus Prometheus-compatible metrics.
- 05Built-in HTTP console on the main port, which can be disabled.
Use cases
- Replacing a Redis deployment that has become CPU-bound on a single thread.
- Serving as a cache layer in front of databases with Redis or Memcached clients.
- Running a key-value store on large cloud instances that have many cores.
- Monitoring in-memory store health with Prometheus and Grafana.
Quick start
- 1
Get a Dragonfly binary by following the quick start guide in the docs
- 2
Run Dragonfly with the example start script options
./dragonfly-x86_64 --logtostderr --requirepass=youshallnotpass --cache_mode=true -dbnum 1 --bind localhost --port 6379 --maxmemory=12gb --keys_output_limit=12288 --dbfilename dump
Things to know
- The metadata lists the license as NOASSERTION, so the license terms need to be checked directly in the repository before use.
- Expiration deadlines above 2^28 ms are rounded to the nearest second, which may not suit every use case.
Topics
FAQ
- What is dragonfly?
- An in-memory data store that is API-compatible with Redis and Memcached, aiming to be a drop-in replacement for both. Dragonfly is an in-memory data store that implements the Redis and Memcached protocols, so existing clients and applications can connect without code changes. It is written in C++ and uses a shared-nothing architecture that partitions the keyspace across threads, letting one instance use multiple CPU cores instead of the single thread that a Redis process typically relies on.
- Is dragonfly free to use? What license does it have?
- dragonfly is open source under the Other license. Check the license terms before using it in commercial products.
- Is dragonfly still maintained?
- Actively maintained. The last commit to dragonfly was on Oct 19, 2026.
- What can I use dragonfly for?
- Replacing a Redis deployment that has become CPU-bound on a single thread. Serving as a cache layer in front of databases with Redis or Memcached clients. Running a key-value store on large cloud instances that have many cores. Monitoring in-memory store health with Prometheus and Grafana.
- How do I install dragonfly?
- Get a Dragonfly binary by following the quick start guide in the docs Run Dragonfly with the example start script options: ./dragonfly-x86_64 --logtostderr --requirepass=youshallnotpass --cache_mode=true -dbnum 1 --bind localhost --port 6379 --maxmemory=12gb --keys_output_limit=12288 --dbfilename dump
- Where can I get dragonfly?
- The source code and installation instructions are on GitHub: https://github.com/dragonflydb/dragonfly
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Apache IoTDB is a time series database for collecting, storing and analyzing IoT sensor data, with SQL-like queries and JDBC access.
Native database IDE for macOS, Windows and Linux supporting PostgreSQL, MySQL, SQLite, Redis, MongoDB, SQL Server and ClickHouse, with a built-in MCP server and AI chat.
The Postgres development platform, offering a hosted Postgres database with auth, auto-generated APIs, storage and realtime features as a Firebase alternative.
Free multi-platform desktop SQL client and database tool supporting 100+ databases via JDBC and ODBC drivers.
Cross-platform SQL editor and database manager for Linux, macOS, and Windows, supporting MySQL, PostgreSQL, SQLite, SQL Server and many more.