Show HN: CasCache – multi-generational cache with optimistic concurrency control
17 days ago
- #performance
- #caching
- #distributed-systems
- Provider-agnostic CAS (Compare-And-Set) cache with pluggable codecs and generation store.
- Safe single-key reads with no stale values and optional bulk caching with read-side validation.
- Opt-in distributed mode for multi-replica deployments with a shared GenStore.
- CAS safety: Writers snapshot a per-key generation before DB read to ensure consistency.
- Singles: Never return stale values; corrupt or type-mismatched entries self-heal.
- Bulk: Cache set-shaped results with validation for each member’s generation.
- Composable: Supports any value provider (Ristretto, BigCache, Redis) and codec (JSON, Msgpack, CBOR, Proto).
- Distributed generations: Optionally use a shared GenStore (e.g., Redis) for cross-replica correctness.
- Performance: O(1) for singles, O(n) for bulk operations; zero-copy wire decode.
- Cleanup: Periodic pruning of local generations with default retention of 30 days.