Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

FusionCache

> 数据库
Open source

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.

3.9K stars0 likes3 views
WebsiteGitHub

About

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.

It was born after years of dealing with all sorts of different types of caches: memory, distributed, hybrid, HTTP caching, CDNs, browser cache, offline cache, you name it.

So I tried to put together these experiences and came up with FusionCache.

Being a hybrid cache means it can transparently work as either a normal memory cache (L1) or as a multi-level cache (L1+L2), where the distributed 2nd level (L2) can be any implementation of the standard IDistributedCache interface: this will get us better cold starts, better horizontal scalability, more resiliency and overall better performance.

FusionCache includes an optional backplane for realtime sync between multiple nodes and advanced resiliency features like cache stampede protection, a fail-safe mechanism, soft/hard timeouts, eager refresh, full observability via logging and OpenTelemetry, tagging and much more.

It's being used in production on real-world projects with huge volumes for years, and is even used by Microsoft itself in its products like Data API Builder.

It's also compatible with the new HybridCache from Microsoft, thanks to a powerful integration.

Awards

FusionCache received the Google Open Source Award: here is the official blogpost.

Getting Started (more)

With A Gentle Introduction you'll get yourself comfortable with the overall concepts.

Want to start using it immediately? There's a ⭐ Quick Start for you.

What about each global or entry option? Sure thing, there's an ️ Options page for that.

Curious about what you can achieve from start to finish? There's a ‍ Step By Step guide.

In search of all the docs? There's a page for that, too.

‍ Courses (more and more)

If you are interested in all things caching, I published 2 courses on Dometrain: Caching in .NET, Getting Started & Deep Dive.

If you like the FusionCache docs, you may like it too.

But mind you, they are not just about FusionCache but about caching as a whole: we'll go from the very foundations to pretty advanced topics and scenarios. We'll cover performance, robustness, resiliency and we'll see different real-world problems and, most importantly, solutions for them.

I tried condensing 20+ years dealing with caching in one place, all in an approachable way.

One journey, two chapters, filled with everything you can ask for about caching.

Talks (more)

Are you more into videos?

Along the years I've been lucky enough to be invited to some conferences, shows or podcasts both online and around the world, of course to talk about all things caching and FusionCache.

A good example is when the fine folks at On .NET invited me on the show to allow me to mumbling random caching stuff.

You can find most of them, sometimes with the related slides, in the dedicated repo here.

✔ Features

FusionCache has a lot of features, let's see them grouped together:

Resiliency

  • ️ Cache Stampede: automatic protection, both local (single node) and distributed (multiple nodes)
  • ** Fail-Safe**: a mechanism to avoids transient failures, by reusing an expired entry as a temporary fallback
  • ↩️ Auto-Recovery: self-healing for the entire cache, all automatically

Performance & Scalability

  • ** L1+L2**: any implementation of IDistributedCache can be used as an optional 2nd level, all transparently
  • ** Backplane**: in a multi-node scenario, it can notify the other nodes about changes in the cache, so all will be in-sync
  • ⏱ Soft/Hard Timeouts: a slow factory (or distributed cache) will not slow down your application, and no data will be wasted
  • ** Eager Refresh**: start a non-blocking background refresh before the expiration occurs
  • ** Conditional Refresh**: like HTTP Conditional Requests, but for caching
  • ** Background Distributed Operations**: distributed operations can easily be executed in the background, safely, for better performance

Flexibility

  • ** Named Caches**: easily work with multiple named caches, even if differently configured
  • ️ Tagging: tags can be associated to entries, to later expire them all at once
  • ** Clear**: clear an entire cache, even with shared L2, cache key prefix, etc
  • Ⓜ️ Microsoft HybridCache: can be used as an implementation of the new HybridCache abstraction from Microsoft, all while adding extra features
  • ‍♂️ Adaptive Caching: for when you don't know upfront the entry options (eg: Duration), since they depends on the value being cached itself
  • ** Dependency Injection + Builder**: native support for Dependency Injection, with a nice fluent interface including a Builder support
  • ♊ Auto-Clone: be sure that cached values returned can be safely modified
  • ** Fully sync/async**: native support for both the synchronous and asynchronous programming model
  • ** Plugins**: extend FusionCache with additional behavior like adding support for metrics, statistics, etc...

Observability

  • ** OpenTelemetry**: native observability support via OpenTelemetry
  • ** Logging**: comprehensive, structured and customizable, via the standard ILogger interface
  • ** Events**: a comprehensive set of events, both at a high level and at lower levels (memory/distributed)

That was a lot, but not all!

Something more ?

Also, FusionCache has some nice additional features:

  • ✅ Portable: targets .NET Standard 2.0, so it can run almost everywhere
  • ✅ High Performance: FusionCache is optimized to minimize CPU usage and memory allocations to get better performance and lower the cost of your infrastructure all while obtaining a more stable, error resilient application
  • ✅ Null caching: explicitly supports caching of null values differently than "no value". This creates a less ambiguous usage, and typically leads to better performance because it avoids the classic problem of not being able to differentiate between "the value was not in the cache, go check the database" and "the value was in the cache, and it was null"
  • ✅ Circuit-breaker: it is possible to enable a simple circuit-breaker for when the distributed cache or the backplane become temporarily unavailable. This will prevent those components to be hit with an excessive load of requests (that would probably fail anyway) in a problematic moment, so it can gracefully get back on its feet. More advanced scenarios can be covered using a dedicated solution, like Polly
  • ✅ Dynamic Jittering: setting JitterMaxDuration will add a small randomized extra duration to a cache entry's normal duration. This is useful to prevent variations of the Cache Stampede problem in a multi-node scenario
  • ✅ Cancellation: every method supports cancellation via the standard CancellationToken, so it is easy to cancel an entire pipeline of operation gracefully
  • ✅ Code comments: every property and method is fully documented in code, with useful informations provided via IntelliSense or similar technologies
  • ✅ Fully annotated for nullability: every usage of nullable references has been annotated for a better flow analysis by the compiler

Ⓜ️ Microsoft HybridCache (more)

We've probably all heard about the new kid on the block introduced by Microsoft with .NET 9: HybridCache.

So what does it mean for FusionCache? Does one replace the other? Or can they somehow work together?

It's pretty cool actually, so let's find out!

Packages

Main packages:

Package Name Version Downloads
ZiggyCreatures.FusionCache
The core package
ZiggyCreatures.FusionCache.OpenTelemetry
Adds native support for OpenTelemetry setup
ZiggyCreatures.FusionCache.Chaos
A package to add some controlled chaos, for testing

Serializers:

Package Name Version Downloads
ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson
A serializer, based on Newtonsoft Json.NET
ZiggyCreatures.FusionCache.Serialization.SystemTextJson
A serializer, based on the new System.Text.Json
ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack
A MessagePack serializer, based on the most used MessagePack serializer on .NET
ZiggyCreatures.FusionCache.Serialization.ProtoBufNet
A Protobuf serializer, based on one of the most used protobuf-net serializer on .NET
ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack
A serializer based on the uber fast new serializer by Neuecc, MemoryPack
[](https://www.nuget.org/packages/ZiggyCreatures.FusionCache.Serialization.Cys

Issues· 34 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#asynccachecache-stampedecaching

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库