Work-state: docs polish —
[########--] 80%
Stashly is a Rust caching framework for building fast, composable cache layers with TTL, singleflight deduplication, CQRS-style read/write separation, and multiple storage backends across memory, Redis, Memcached, and disk. It is structured as a hexagonal architecture so the cache core stays portable while adapters handle backend-specific behavior, metrics, and persistence concerns.
Add Stashly to your project:
[dependencies]
stashly = { git = "https://github.com/KooshaPari/Stashly" }Create a cache and use it:
use stashly::InMemoryCache;
let cache = InMemoryCache::new();
cache.set("key", "value").await?;
let value = cache.get("key").await?;For multi-tier caching, use the tiered adapter with your preferred capacity and TTL settings.
- Multiple backends: Memory, Redis, Memcached, Disk
- Multi-tier caching: L1, L2, L3
- Singleflight request deduplication
- TTL expiration
- CQRS-oriented interfaces
- Domain events and metrics
MIT OR Apache-2.0