← Back to posts
comparison redis cache · · 10 min read

Valkey vs DragonflyDB vs Garnet: Best Redis Alternatives in 2026 (Docker Setup)

Compare the top open-source Redis alternatives in 2026: Valkey, DragonflyDB, and Microsoft Garnet. Benchmarks, Docker compose setups, and migration guides for every use case.

OS
Editorial Team

Why You Need a Redis Alternative in 2026

When Redis changed its license to dual SSPL/BSDL in March 2024, the open-source community responded with a wave of alternatives. Two years later, the landscape has matured into three serious contenders — each with a fundamentally different architecture:

  • Valkey — the Linux Foundation–backed fork of Redis 7.2, drop-in compatible
  • DragonflyDB — a modern, multi-threaded engine built from scratch in C++
  • Microsoft Garnet — a high-performance cache-store from Microsoft Research in C#

Whether you’re running a high-throughput API, a session store, or a real-time analytics pipeline, picking the right cache layer matters. Here’s how they stack up.

Quick Comparison Table

FeatureValkeyDragonflyDBMicrosoft Garnet
LicenseBSD-3-ClauseBSD-3-ClauseMIT
LanguageCC++C#
Latest Version9.0 (stable)v1.371.0+
GitHub Stars25,400+30,300+11,700+
ArchitectureSingle-threaded (like Redis)Multi-threaded (shared-nothing)Multi-threaded (TSO)
Redis CompatibilityDrop-in (100% API)~95% commands~90% commands
Cluster Support✅ Native✅ Native (Dragonfly Cluster)❌ Single-node only
PersistenceRDB + AOFRDB + AOFCheckpointing
Min RAM~10 MB~64 MB~128 MB
docker Image Size~80 MB~50 MB~200 MB
Replication✅ Master-Replica✅ Multi-master✅ Primary-Replica
TLS Support
Backed ByLinux Foundation (AWS, Google, Oracle)DragonflyDB Inc.Microsoft Research

Valkey — The Community Fork

Valkey was born as a direct response to the Redis license change. Forked from Redis 7.2.4 and hosted under the Linux Foundation, it’s the most conservative choice — and often the easiest migration path.

Key Features

  • Drop-in replacement: If your app works with Redis, it works with Valkey. Zero code changes needed.
  • Linux Foundation governance: Backed by AWS, Google, Oracle, and Ericsson — no single vendor controls the roadmap.
  • Active development: 25,400+ GitHub stars with regular releases (v9.0 stable, v9.1 in RC as of April 2026).
  • Modules support: Valkey continues the Redis Modules ecosystem (search, JSON, time-series).
  • Proven at scale: Powers workloads at AWS ElastiCache, Google Cloud Memorystore, and Oracle Cloud Infrastructure.

Docker Deployment

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
services:
  valkey:
    image: valkey/valkey:9.0
    container_name: valkey
    restart: unless-stopped
    ports:
      - "6379:6379"
    volumes:
      - valkey-data:/data
      - ./valkey.conf:/usr/local/etc/valkey/valkey.conf:ro
    command: valkey-server /usr/local/etc/valkey/valkey.conf
    healthcheck:
      test: ["CMD", "valkey-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      resources:
        limits:
          memory: 1G

  # Optional: Valkey Commander (Redis Commander-compatible UI)
  valkey-ui:
    image: rediscommander/redis-commander:latest
    container_name: valkey-ui
    restart: unless-stopped
    ports:
      - "8081:8081"
    environment:
      - REDIS_HOSTS=local:valkey:6379
    depends_on:
      - valkey

volumes:
  valkey-data:

valkey.conf (minimal production config):

1
2
3
4
5
6
7
bind 0.0.0.0
port 6379
appendonly yes
appendfsync everysec
maxmemory 512mb
maxmemory-policy allkeys-lru
requirepass your-strong-password-here

When to Choose Valkey

  • You need zero-downtime migration from an existing Redis deployment
  • Your team relies on Redis Sentinel or Cluster mode
  • You want the safest, most battle-tested option
  • You need Redis Modules (ValkeyJSON, ValkeySearch, etc.)

DragonflyDB — The Modern Multi-Threaded Engine

DragonflyDB takes a completely different approach. Instead of cloning Redis’s single-threaded model, it uses a shared-nothing, multi-threaded architecture with a shard-per-core design. The result: dramatically higher throughput on multi-core machines.

Key Features

  • Multi-threaded by design: Unlike Redis/Valkey, Dragonfly uses every CPU core natively. Benchmarks show 25x higher throughput than Redis on the same hardware.
  • 95% Redis API compatibility: Covers all common commands (strings, lists, sets, hashes, ZSETs, streams, pub/sub, transactions).
  • Memory efficient: Uses a novel tiered storage engine and memory-efficient data structures.
  • Dragonfly Cluster: Native distributed cluster mode with automatic key migration and slot rebalancing.
  • Active development: 30,300+ GitHub stars, v1.37 released in March 2026 with continuous improvements.
  • Built-in dashboard: Real-time metrics via HTTP endpoint (/metrics).

Docker Deployment

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
services:
  dragonfly:
    image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.37
    container_name: dragonfly
    restart: unless-stopped
    ulimits:
      memlock: -1
    ports:
      - "6379:6379"
      - "9999:9999"  # Metrics/dashboard
    volumes:
      - dragonfly-data:/data
    command:
      - --cache_mode=true
      - --maxmemory=1gb
      - --dir=/data
      - --dbfilename=dragonfly-snapshot
      - --logtostderr
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      resources:
        limits:
         [prometheus](https://prometheus.io/)G

  # Optional: Prometheus metrics scraping
  prometheus:
    image: prom/prometheus:latest
    container_name: df-prometheus
    restart: unless-stopped
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
    depends_on:
      - dragonfly

volumes:
  dragonfly-data:

prometheus.yml (for metrics):

1
2
3
4
scrape_configs:
  - job_name: dragonfly
    static_configs:
      - targets: ['dragonfly:9999']

When to Choose DragonflyDB

  • You have multi-core servers (4+ cores) and want maximum throughput
  • You’re starting a new project and don’t need 100% Redis compatibility
  • You want better memory efficiency for large datasets
  • You need built-in observability (Prometheus metrics out of the box)

Microsoft Garnet — The C# Powerhouse

Microsoft Garnet is the newest entrant, released by Microsoft Research in 2024. Written in C#, it uses a novel thread-per-core architecture with shared storage objects (TSO) to achieve competitive performance while maintaining a completely different codebase from Redis.

Key Features

  • MIT License: The most permissive license of the three — zero restrictions for commercial use.
  • C# / .NET ecosystem: Easy to integrate if your stack is already .NET-based.
  • Competitive performance: Microsoft Research papers show Garnet matching or exceeding Redis on many benchmarks, particularly for small-object operations.
  • Storage tier: Built-in support for tiered storage to disk without sacrificing latency.
  • Cluster mode planned: While currently single-node, clustering is on the roadmap.
  • Growing adoption: 11,700+ GitHub stars, active Microsoft backing.

Docker Deployment

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
services:
  garnet:
    image: ghcr.io/microsoft/garnet:latest
    container_name: garnet
    restart: unless-stopped
    ports:
      - "6379:6379"
      - "9999:9999"  # Metrics
    volumes:
      - garnet-data:/data
    command:
      - "--port"
      - "6379"
      - "--checkpoint-dir"
      - "/data"
      - "--enable-cluster"
      - "false"
      - "--memory-size"
      - "1g"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      resources:[grafana](https://grafana.com/)  limits:
          memory: 2G

  # Optional: Grafana dashboard for monitoring
  grafana:
    image: grafana/grafana:latest
    container_name: garnet-grafana
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
    depends_on:
      - garnet

volumes:
  garnet-data:

When to Choose Garnet

  • Your application stack is already .NET / C#
  • You need the most permissive license (MIT)
  • You’re evaluating options and want a fresh perspective on caching
  • You value Microsoft’s engineering rigor and long-term support

Performance & Resource Comparison

Throughput (Single Node, 8-Core Machine)

BenchmarkValkeyDragonflyDBGarnet
SET (simple key-value)~200K ops/s~3.5M ops/s~1.8M ops/s
GET (simple key-value)~220K ops/s~3.8M ops/s~2.0M ops/s
LPUSH + LPOP~180K ops/s~2.5M ops/s~1.2M ops/s
HSET (10 fields)~150K ops/s~2.0M ops/s~1.0M ops/s

Benchmarks based on published results from each project. Your actual throughput depends on hardware, key size, network, and workload patterns. Always benchmark your own workload.

Memory Usage

ScenarioValkeyDragonflyDBGarnet
Idle (no data)~10 MB~64 MB~128 MB
1M string keys (64B each)~140 MB~95 MB~110 MB
1M hash keys (10 fields)~320 MB~200 MB~250 MB

DragonflyDB’s Deflate-based compression and Dragonfly-specific data structures give it the best memory efficiency. Valkey inherits Redis’s memory model (efficient for a single-threaded design). Garnet sits in the middle with .NET’s GC overhead but competitive raw performance.

CPU Scaling

  • Valkey: Single-threaded. Adding more cores doesn’t help unless you run multiple instances with client-side sharding or cluster mode.
  • DragonflyDB: Scales linearly with cores. An 8-core machine gets ~8x the throughput of a single-core instance.
  • Garnet: Multi-threaded with thread-per-core design. Good scaling up to ~16 cores.

Migration Guide: Redis → Valkey / Dragonfly / Garnet

From Redis to Valkey (Easiest)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 1. Stop your Redis instance
docker stop redis-old

# 2. Start Valkey with the same data directory
docker run -d --name valkey \
  -v /path/to/redis-data:/data \
  -p 6379:6379 \
  valkey/valkey:9.0

# 3. Verify — same commands, same port, same protocol
redis-cli -p 6379 ping
# PONG

No code changes needed. Your application connects to port 6379 and speaks the exact same protocol.

From Redis to DragonflyDB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 1. Start DragonflyDB
docker run -d --name dragonfly \
  -p 6379:6379 \
  docker.dragonflydb.io/dragonflydb/dragonfly:v1.37

# 2. Migrate data using Redis MIGRATE or dump/restore
redis-cli -h old-redis --rdb /tmp/dump.rdb

# 3. Or use Dragonfly's built-in replication from your old Redis
# Add to dragonfly command: --replicaof=old-redis 6379

Dragonfly supports --replicaof for live migration from an existing Redis instance.

From Redis to Garnet

1
2
3
4
5
6
7
8
# 1. Start Garnet
docker run -d --name garnet \
  -p 6379:6379 \
  ghcr.io/microsoft/garnet:latest

# 2. Use redis-cli to dump and restore
redis-cli -h old-redis --rdb /tmp/dump.rdb
# Then load into Garnet

Garnet speaks the Redis protocol (RESP2/RESP3), so standard Redis migration tools work.

Frequently Asked Questions

Is Valkey a drop-in replacement for Redis?

Yes. Valkey is forked from Redis 7.2.4 and maintains 100% API compatibility. Any Redis client library, Redis module, or Redis-compatible tool works with Valkey without modification. The protocol, command syntax, and data formats are identical.

Can I migrate from Redis to DragonflyDB without downtime?

Yes. DragonflyDB supports live replication from an existing Redis instance using the --replicaof=<redis-host> <redis-port> flag. Dragonfly acts as a read replica, syncs all data, and then you can promote it to primary with zero data loss.

Does DragonflyDB support Redis modules?

No. DragonflyDB reimplements the most commonly used Redis commands natively but does not support the Redis Modules API (RediSearch, RedisJSON, RedisGraph, etc.). If you depend on modules, Valkey is the better choice since it maintains module compatibility.

Which is faster: Valkey or DragonflyDB?

For single-threaded workloads, they are similar since Valkey uses the same single-threaded model as Redis. On multi-core machines (4+ cores), DragonflyDB is significantly faster — up to 25x higher throughput in published benchmarks — because it uses all cores natively while Valkey is limited to one.

Is Microsoft Garnet production-ready?

Microsoft Garnet is actively used within Microsoft and has a stable 1.0+ release. However, it lacks cluster mode (single-node only as of v1.x) and has less battle-testing than Valkey or DragonflyDB. It’s a solid choice for single-node caching, especially in .NET environments, but may not be ready for large-scale distributed deployments yet.

Which Redis alternative has the best license?

  • Garnet: MIT License — the most permissive, no restrictions whatsoever.
  • Valkey: BSD-3-Clause — very permissive, requires attribution.
  • DragonflyDB: BSD-3-Clause — same as Valkey, very permissive.

All three are significantly more permissive than Redis’s current SSPL/BSDL dual license.

Can I run these alternatives on a Raspberry Pi or low-resource machine?

Yes. Valkey has the smallest footprint (~10 MB idle) and runs on ARM64 and ARMv7. DragonflyDB requires more RAM (~64 MB minimum) and currently only supports x86_64 and ARM64. Garnet requires the .NET runtime (~128 MB minimum) and supports ARM64. For a Raspberry Pi 4 with 4GB RAM, Valkey is the best fit.

How do I monitor these alternatives with Prometheus and Grafana?

All three expose Prometheus-compatible metrics:

  • Valkey: Export via valkey-exporter (similar to redis_exporter)
  • DragonflyDB: Built-in metrics endpoint at http://<host>:9999/metrics
  • Garnet: Built-in metrics endpoint at http://<host>:9999/metrics

Grafana dashboards are available for all three — search the Grafana dashboard repository for “Valkey”, “Dragonfly”, or “Garnet”.

Conclusion: Which Should You Choose?

Here’s our recommendation based on use case:

Your SituationRecommendation
Migrating from Redis with zero code changesValkey — it’s a drop-in replacement, period
Maximum throughput on multi-core serversDragonflyDB — 25x throughput gains are real
Existing .NET / C# stackGarnet — native .NET integration, MIT license
Need Redis Modules (search, JSON, graph)Valkey — only option with module support
Running on low-resource hardware (Pi, VPS)Valkey — smallest memory footprint
Starting a new greenfield projectDragonflyDB — modern architecture, great DX
Most permissive commercial licenseGarnet — MIT license, zero restrictions

For most teams migrating from Redis today, Valkey is the safest and fastest path. For teams building new infrastructure or hitting Redis’s single-threaded ceiling, DragonflyDB is the performance king. And for .NET shops, Garnet is worth serious consideration.

All three are open source, all three are production-ready, and all three are better licensed than current Redis. You can’t go wrong — but choosing the right one for your workload matters.


Last updated: April 2026. Benchmarks are from published project documentation. Always test with your own workload before making a production decision.

Advertise here