A high-performance multi-layered caching library for .NET, combining in-memory, file, Redis, and MongoDB layers for speed and resilience.
Cache Tower is a multi-layered caching library for .NET that allows developers to combine different cache storage types—such as in-memory, file-based, Redis, and MongoDB—into a single stack. It solves the problem of balancing cache speed with resilience by enabling fast in-memory layers backed by persistent layers, preventing data loss on application restarts and supporting distributed systems.
.NET developers building high-performance web applications, microservices, or distributed systems that require efficient, scalable caching with options for both local and distributed cache layers.
Developers choose Cache Tower for its unique multi-layer architecture, which provides the speed of in-memory caches with the durability of file or database caches. Its background refreshing feature minimizes cache misses, and Redis extensions offer distributed coordination out of the box, making it ideal for scalable applications.
An efficient multi-layered caching system for .NET
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows stacking cache layers from fast in-memory to persistent Redis or file-based caches, inspired by Stack Overflow's architecture, for optimal performance and resilience across application restarts.
Automatically refreshes stale cache entries in the background to prevent expired-data cache misses, improving throughput without blocking requests, as detailed in the README's example flow.
Redis extensions provide distributed locking and eviction, synchronizing caches across multiple application instances to avoid cache stampedes, essential for scalable microservices.
Supports JSON (Newtonsoft.Json, System.Text.Json) and Protobuf serializers, offering flexibility for different performance and compatibility needs, with specific packages for each.
Setting up multiple cache layers and extensions requires detailed configuration and understanding of each layer's trade-offs, which can be daunting compared to simpler caching solutions.
Only supports in-memory, file, Redis, and MongoDB out of the box; for other databases like SQL Server, developers must implement custom ICacheLayer interfaces, adding development overhead.
Using the Protobuf serializer requires decorating classes with [ProtoContract] and [ProtoMember] attributes, adding maintenance overhead and potential for errors, as noted in the README.