Expand description
Cache Backend Implementations
This module contains all cache backend implementations for the multi-tier cache system.
§Available Backends
§In-Memory (L1 Tier)
- Moka - High-performance concurrent cache with automatic eviction (default L1)
- DashMap - Simple concurrent HashMap-based cache
- QuickCache - Lightweight, optimized for maximum performance (feature:
backend-quickcache)
§Distributed (L2 Tier)
- Redis - Industry-standard distributed cache with persistence (default L2)
- Memcached - Lightweight distributed cache (feature:
backend-memcached)
§On-Disk (L3/L4 Tier)
- RocksDB - Embedded persistent key-value store (coming soon)
§Usage
use multi_tier_cache::backends::{MokaCache, RedisCache};
// Explicit backend selection
let moka = MokaCache::new().await?;
let redis = RedisCache::new().await?;
// Or use type aliases for backward compatibility
use multi_tier_cache::backends::{L1Cache, L2Cache};
let l1 = L1Cache::new().await?; // MokaCache
let l2 = L2Cache::new().await?; // RedisCacheRe-exports§
pub use moka_cache::MokaCache;pub use redis_cache::RedisCache;pub use dashmap_cache::DashMapCache;
Modules§
- dashmap_
cache - DashMap Cache - Simple Concurrent HashMap Backend
- moka_
cache - Moka Cache - In-Memory Cache Backend
- redis_
cache - Redis Cache - Distributed Cache Backend