Tech News
← Back to articles

Show HN: CasCache – multi-generational cache with optimistic concurrency control

read original related products more articles

cascache

Provider-agnostic CAS like (Compare-And-Set or generation-guarded conditional set) cache with pluggable codecs and a pluggable generation store. Safe single-key reads (no stale values), optional bulk caching with read-side validation, and an opt‑in distributed mode for multi-replica deployments.

Contents

Overview

CAS safety: Writers snapshot a per-key generation before the DB read. Cache writes commit only if the generation is unchanged.

Writers snapshot a per-key before the DB read. Cache writes commit only if the generation is unchanged. Singles: Never return stale values; corrupt/type-mismatched entries self-heal.

Never return stale values; corrupt/type-mismatched entries self-heal. Bulk: Cache a set-shaped result. On read, validate every member’s generation. Reject the bulk if any member is stale.

Cache a set-shaped result. On read, validate every member’s generation. Reject the bulk if any member is stale. Composable: Plug any value provider (Ristretto/BigCache/Redis) and any codec (JSON/Msgpack/CBOR/Proto).

Plug any value provider (Ristretto/BigCache/Redis) and any codec (JSON/Msgpack/CBOR/Proto). Distributed Keep local generations (default) or plug a shared GenStore (e.g., Redis) for cross-replica correctness and warm restarts.

Read path (single)

... continue reading