Skip to content

feat(store): add SLRU-backed persistent chunk cache#442

Open
kisielewski wants to merge 1 commit into
feat/chunk-read-write-optimization-for-search-apifrom
feat/cache-srlu-policy
Open

feat(store): add SLRU-backed persistent chunk cache#442
kisielewski wants to merge 1 commit into
feat/chunk-read-write-optimization-for-search-apifrom
feat/cache-srlu-policy

Conversation

@kisielewski

@kisielewski kisielewski commented May 25, 2026

Copy link
Copy Markdown
Member

Important

Depends on: #436 — chunk read cache, batched writes, and in-memory file size
Do not merge before #436 is merged.

Depends on #436 (feat/chunk-read-write-optimization-for-search-api)

Summary

  • Introduces SlruPolicy — an in-memory Segmented LRU eviction tracker
    with two segments (Probationary / Protected)
  • Adds CacheBackendInterface abstraction for pluggable persistent storage,
    with CacheBackendInMemory as the default in-memory implementation
  • Implements SlruBackedCache — a CacheInterface backed by any
    CacheBackendInterface, persisting both values and SLRU metadata
    (segment, sequence, size) so eviction order survives process restarts
  • Extends GlobalCache with setChunksCacheBackend() for supplying an
    external backend (e.g. LevelDB); the built-in path now routes through
    SlruBackedCache + CacheBackendInMemory by default

@kisielewski kisielewski force-pushed the feat/cache-srlu-policy branch from 040e401 to 716c0a9 Compare May 28, 2026 14:15
@kisielewski kisielewski self-assigned this May 28, 2026
@kisielewski kisielewski force-pushed the feat/cache-srlu-policy branch from 716c0a9 to 0f3711b Compare May 28, 2026 19:01
@kisielewski kisielewski changed the base branch from feat/search-api to feat/chunk-read-write-optimization-for-search-api May 28, 2026 19:35
Introduces a segmented LRU (SLRU) eviction policy and a pluggable cache
backend abstraction. GlobalCache now uses SlruBackedCache with an
in-memory backend by default, and exposes setChunksCacheBackend() for
external persistent backends (e.g. LevelDB).
@kisielewski kisielewski force-pushed the feat/cache-srlu-policy branch from 0f3711b to 62a6403 Compare May 29, 2026 08:57
@kisielewski kisielewski marked this pull request as ready for review May 29, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant