Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 13, 2026·3 min de lectura

Garnet — High-Performance Cache Store from Microsoft Research

Garnet is a remote cache-store from Microsoft Research that offers strong performance, scalability, and Redis protocol compatibility. Written in C#, it leverages .NET for cross-platform support and modern hardware optimization.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
step-1.md
Comando de instalación directa
npx -y tokrepo@latest install 8d8fdb8c-3734-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

TL;DR
Garnet is a Microsoft Research cache-store offering Redis compatibility, strong performance, and .NET cross-platform support.
§01

What it is

Garnet is a remote cache-store from Microsoft Research that offers strong performance, scalability, and Redis protocol compatibility. Written in C#, it leverages the .NET runtime for cross-platform support and modern memory management.

Garnet targets teams looking for a Redis-compatible cache with better throughput and lower tail latency at scale. It is designed for high-concurrency workloads where predictable performance matters.

The project is actively maintained and suitable for both individual developers and teams looking to integrate it into their existing toolchain. Documentation and community support are available for onboarding.

§02

How it saves time or tokens

Garnet is a drop-in replacement for Redis in most scenarios. Existing Redis client libraries work without modification because Garnet implements the Redis serialization protocol (RESP). Migration from Redis requires no application code changes. Garnet's threading model reduces tail latency under high concurrency, meaning fewer retries and timeouts in your application.

§03

How to use

  1. Download Garnet from GitHub releases or build from source with .NET 8+.
  2. Start the Garnet server: dotnet run --project Garnet -- --port 6379
  3. Connect using any Redis client library (redis-py, ioredis, go-redis, etc.).
  4. Use standard Redis commands (GET, SET, HSET, LPUSH, etc.).
§04

Example

# Build and run Garnet
git clone https://github.com/microsoft/garnet.git
cd garnet
dotnet restore
dotnet run --project Garnet -- --port 6379

# Connect with redis-cli (works because Garnet speaks RESP)
redis-cli -p 6379
> SET mykey 'hello'
OK
> GET mykey
"hello"
> HSET user:1 name 'Alice' age 30
(integer) 2
> HGETALL user:1
1) "name"
2) "Alice"
3) "age"
4) "30"
§05

Related on TokRepo

§06

Common pitfalls

  • Assuming 100% Redis command coverage. Garnet implements the most common Redis commands but not all. Check the compatibility matrix for Lua scripting, Pub/Sub, and cluster commands before migrating.
  • Not benchmarking with your specific workload. Garnet's performance advantages vary by access pattern. Run your actual workload against both Garnet and Redis to measure the difference.
  • Skipping persistence configuration. By default, Garnet stores data in memory only. Configure checkpointing for durability if your use case requires data survival across restarts.
  • Not reading the changelog before upgrading. Breaking changes between versions can cause unexpected failures in production. Pin your version and review release notes.

Preguntas frecuentes

Is Garnet a Redis fork?+

No. Garnet is built from scratch in C# by Microsoft Research. It implements the Redis protocol (RESP) for compatibility but uses a completely different internal architecture optimized for modern hardware.

Which Redis commands does Garnet support?+

Garnet supports the most commonly used Redis commands including strings, hashes, lists, sets, sorted sets, and HyperLogLog. Some advanced features like Lua scripting and Redis Cluster protocol have limited support.

Does Garnet support clustering?+

Garnet supports sharding for horizontal scalability. The clustering model is different from Redis Cluster. Check the Garnet documentation for the current state of cluster support.

What are the performance advantages?+

Garnet's architecture uses a FASTER-based storage engine and a scalable threading model. Benchmarks show higher throughput and lower p99 latency compared to Redis under high concurrency. Results depend on workload characteristics.

Can I run Garnet on Linux?+

Yes. Garnet runs on .NET 8, which supports Linux, macOS, and Windows. The C# codebase is fully cross-platform with no OS-specific dependencies.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados