An in-memory data store that is API-compatible with Redis and Memcached, aiming to be a drop-in replacement for both.
microsoft/garnet
A C# remote cache-store that speaks the Redis RESP protocol, so existing Redis clients can connect to it without changes.
Open-source alternative to:Redis
- Stars
- 12,078
- Forks
- 722
- Open issues
- 81
- Last commit
- 23 hours ago
What is it?
Garnet is a remote cache-store built by Microsoft Research. It adopts the RESP wire protocol, so unmodified Redis clients such as StackExchange.Redis in C# can talk to it. It targets high throughput with many client connections and small batches, and aims for low client latency in cloud deployments.
Garnet supports raw string operations with key expiration, plus HyperLogLog, bitmaps, sorted sets, lists, hashes and other object types. Multi-key transactions are available through client-side RESP transactions, server-side stored procedures, and custom extensions written in C#. Lua scripts are also supported, and TLS is provided through .NET's SslStream.
The storage layer, Tsavorite, can tier data across memory, SSD and cloud storage, and it supports checkpointing, recovery and operation logging for durability. Cluster mode adds sharding, replication and dynamic key migration, with standard Redis cluster commands for management. Preview features include vector sets for approximate nearest-neighbor search and range indexes over keys.
Key features
- 01Works with unmodified Redis clients via the RESP protocol.
- 02Supports strings, HyperLogLog, bitmaps, sorted sets, lists, hashes and geo types.
- 03Allows custom operations and stored procedures written in C#.
- 04Offers TLS communication and basic access control.
- 05Tiers storage across memory, SSD and cloud, with checkpointing and recovery.
- 06Provides cluster mode with sharding, replication and key migration.
Use cases
- Replacing a Redis cache in a .NET service while keeping existing client code.
- Serving high-concurrency workloads where many clients send small requests.
- Building custom cache logic or data types in C# on top of a Redis-compatible server.
- Running a sharded, replicated cache cluster on cloud VMs.
Quick start
- 1
Follow the getting started guide in the project documentation
Things to know
- Vector Sets and Range Index are in preview.
- Cluster mode is passive and does not implement leader election; an external control plane must issue cluster commands.
In collections
Topics
FAQ
- What is garnet?
- A C# remote cache-store that speaks the Redis RESP protocol, so existing Redis clients can connect to it without changes. Garnet is a remote cache-store built by Microsoft Research. It adopts the RESP wire protocol, so unmodified Redis clients such as StackExchange.Redis in C# can talk to it. It targets high throughput with many client connections and small batches, and aims for low client latency in cloud deployments.
- Is garnet free to use? What license does it have?
- garnet is open source under the MIT license. Check the license terms before using it in commercial products.
- Is garnet still maintained?
- Actively maintained. The last commit to garnet was on Nov 6, 2026.
- What can I use garnet for?
- Replacing a Redis cache in a .NET service while keeping existing client code. Serving high-concurrency workloads where many clients send small requests. Building custom cache logic or data types in C# on top of a Redis-compatible server. Running a sharded, replicated cache cluster on cloud VMs.
- How do I install garnet?
- Follow the getting started guide in the project documentation
- Where can I get garnet?
- The source code and installation instructions are on GitHub: https://github.com/microsoft/garnet
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A high-performance, Redis-compatible key-value data structure server forked from Redis, aimed at caching and realtime workloads.
A multithreaded, Redis-compatible in-memory database and drop-in replacement for Redis, with active-active replication and optional FLASH storage.
A Node.js key-value storage library with TTL expiry and pluggable backends such as Redis, MongoDB, SQLite and PostgreSQL.
A .NET client library for connecting to Redis and other RESP-compatible servers such as Valkey, Garnet and AWS ElastiCache.
A distributed NoSQL key-value database that uses RocksDB for storage and speaks the Redis protocol, so existing Redis clients can connect.