microsoft/garnet

Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster...

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 39 minutes ago
Added to GitGenius on April 7th, 2024
Created on August 21st, 2023
Open Issues & Pull Requests: 42 (+0)
Number of forks: 691
Total Stargazers: 11,949 (+0)
Total Subscribers: 71 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 18.3 hours
Mean response time: 10.3 days
90th percentile: 16.7 days
Tracked items: 316

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "answered" is answered fastest, typically in about 8 hours, while "API" waits about 8 days. Only 11% of issues opened in the past year have been closed. Three people close 76% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 22
New in 7 days: 4
Closed in 7 days: 3
Avg open age: 339 days
Stale 30+ days: 19
Stale 90+ days: 17

Recent activity

Opened in 7 days: 4
Closed in 7 days: 3
Comments in 7 days: 0
Events in 7 days: 5

Top labels

  • enhancement (46)
  • bug (39)
  • help wanted (39)
  • question (34)
  • answered (33)
  • API (19)
  • good first issue (13)
  • security (3)

Detailed Description

Garnet is a remote cache-store developed by Microsoft Research that reimplements the entire cache-store stack to achieve high throughput, low latency, and strong scalability. Written in C# and built on modern .NET technology, Garnet adopts the RESP wire protocol used by Redis, enabling compatibility with existing Redis clients across most programming languages without modification. This design choice allows developers to use Garnet as a drop-in replacement for Redis-compatible systems while gaining significant performance improvements.

The repository demonstrates exceptional performance characteristics, particularly client latencies often below 300 microseconds at the 99.9th percentile when running on Azure VMs with Accelerated Networking. Garnet achieves state-of-the-art performance on both Linux and Windows platforms through careful optimization of .NET usage. The system is designed to handle many client connections with small batches more efficiently than comparable open-source cache-stores, directly translating to cost savings for large applications and services.

Garnet's architecture separates concerns through a narrow-waist Tsavorite storage API that implements read, upsert, delete, and atomic read-modify-write operations with asynchronous callbacks. This design cleanly decouples parsing and query processing from storage details including concurrency, storage tiering, and checkpointing. The storage layer consists of two Tsavorite key-value stores bound by a unified operation log: a main store optimized for raw string operations with careful memory management to avoid garbage collection, and an optional object store optimized for complex objects and custom data types like Sorted Sets, Sets, Hashes, Lists, and Geo types.

The network layer uses a shared memory design where TLS processing and storage interactions occur on the network IO completion thread, avoiding thread switching overheads in common cases. This approach leverages CPU cache coherence to bring data to processing logic rather than requiring traditional data movement to appropriate shards. Garnet implements a wide range of APIs including raw strings with key expiration, analytical operations like HyperLogLog and Bitmap, and object operations. It supports multi-key transactions through client-side RESP transactions, server-side stored procedures and modules written in C#, and Lua scripts.

Garnet's cluster mode provides fully-featured sharding and replication with efficient dynamic key migration for rebalancing. The cluster design is passive, responding to user-provided control plane commands rather than implementing internal leader election. Users can manage clusters using standard Redis cluster commands with nodes performing gossip to share cluster state.

Recent additions include Vector Sets in preview, providing approximate nearest-neighbor search backed by the DiskANN algorithm and Garnet's Tsavorite storage engine, and Range Index in preview, offering secondary range and equality indexes over Garnet keys powered by Bf-Tree. The Garnet paper is appearing at VLDB 2026, documenting the research behind this next-generation cache-store.

The repository shares contributors with microsoft/vscode, microsoft/typescript, and rust-lang/rust, indicating cross-project collaboration within the broader Microsoft and open-source ecosystems.