Introducing Garnet
Garnet is a research project from Microsoft Research. It is a remote cache-store designed to offer high performance, extensibility, and low latency. Garnet is thread-scalable within a single node. It also supports sharded cluster execution, with replication, checkpointing, failover, and transactions. It can operate over main memory as well as tiered storage (such as SSD and Azure Storage). Garnet supports a rich API surface and a powerful extensibility model.
Garnet uses Redis’ RESP (opens in new tab) as the starting point for its wire protocol. Thus, one can use Garnet with unmodified Redis clients available (opens in new tab) in most programming languages, for example, with StackExchange.Redis (opens in new tab) in C#. Compared to other open-source cache-stores, you get much better performance, latency, extensibility, and durability features.
Version of Garnet have been deployed in several real-world use cases at Microsoft, such as those in the Windows & Web Experiences Platform, Azure Resource Manager, and Azure Resource Graph. Garnet is also now open-source at https://github.com/microsoft/garnet (opens in new tab).
High Performance
Garnet uses a thread-scalable storage layer called Tsavorite, which provides cache-friendly shared-memory scalability with tiered storage support. Garnet supports cluster mode (sharding and replication). It has a fast pluggable network design to get high end-to-end performance (throughput and 99th percentile latency).
Rich & Extensible
Garnet uses the popular RESP wire protocol, allowing it to be used with unmodified Redis clients in any language. Garnet supports a large fraction of the Redis API surface, including raw strings and complex data structures such as sorted sets, bitmaps, and HyperLogLog. Garnet also has scalable extensibility and transactional stored procedure capabilities.
Modern & Secure
The Garnet server is written in modern .NET C#, and runs efficiently on almost any platform. It works equally well on Windows and Linux, and is designed to not incur garbage collection overheads. You can also extend Garnet’s capabilities using new .NET data structures to go beyond the core API. Finally, Garnet has efficient TLS support out of the box.
Key advantages
Garnet offers several unique benefits:
- Garnet adopts the popular RESP wire protocol as a starting point, which makes it possible to use Garnet from unmodified Redis clients available in most programming languages today.
- Garnet offers much better throughput and scalability with many client connections and small batches, relative to comparable open-source cache-stores, leading to cost savings for large apps and services.
- Garnet demonstrates extremely low client latencies (often less than 300 microseconds at the 99.9th percentile) using commodity cloud (Azure) VMs with accelerated TCP enabled, which is critical to real-world scenarios.
- Based on the latest .NET technology, Garnet is cross-platform, extensible, and modern. It is designed to be easy to develop for and evolve, without sacrificing performance in the common case. We leveraged the rich library ecosystem of .NET for API breadth, with open opportunities for optimization. Thanks to our careful use of .NET, Garnet achieves state-of-the-art performance on both Linux and Windows.
More information
Learn more about Garnet from the following links:
- GitHub: https://github.com/microsoft/garnet (opens in new tab)
- Website: https://microsoft.github.io/garnet (opens in new tab)
Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Microsoft is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Microsoft.