CacheKit Docs
CacheKit is a Rust library for building high-performance caches with pluggable eviction policies and supporting data structures.
Key features:
- Multiple eviction policies (LRU, LFU, LRU-K, 2Q, Clock, S3-FIFO)
- Composable cache building blocks with a unified builder API
- Optional metrics and benchmark tooling
Getting Started
- Quickstart — Install and build your first cache
- Integration guide — CacheBuilder API, policy selection, thread safety
- Design overview — Architectural decisions and performance principles
- Cache trait hierarchy — Kernel trait, capability traits, read/mutate split
- Concurrency —
Concurrent* wrappers, lock discipline, sharded primitives
- Builder and runtime dispatch —
CachePolicy, DynCache, enum dispatch
- Weighted eviction —
WeightStore, dual limits, GDS/GDSF pre-staging
- Metrics — Recorder / snapshot / exporter split, Prometheus integration
- Error model — Panic vs
Result discipline, four error types
- Benchmarking design — Benchmark layers, policy registry, JSON artifacts
- Hashing and key identity — Hasher choices, key interning, shard routing
- Sharding — Sharded primitives, routing, capacity semantics
- Storage layer — Store trait family, concrete stores,
StoreMetrics baseline
- Serialization —
serde surface and cache-state persistence boundaries
- Non-goals — Explicit boundaries and out-of-scope features
- TTL design — Worked example of every principle in one feature
- API surface — Module map and entrypoints
Policies
Internals
Benchmarks
Release and Maintenance
Testing and Fuzzing