Module cache

Module cache 

Source
Expand description

Caching layer for VelesDB (SOTA 2026).

Based on arXiv:2310.11703v2 recommendations:

  • LRU cache for metadata-only collections
  • Bloom filter for existence checks
  • Cache statistics and monitoring

§Thread-Safety & Lock Ordering

All structures are thread-safe via parking_lot::RwLock.

Lock Hierarchy (acquire in this order to prevent deadlocks):

  1. BloomFilter.bits (RwLock)
  2. BloomFilter.count (RwLock)
  3. LruCache.inner (RwLock)

Structs§

BloomFilter
Bloom filter for probabilistic existence checks.
CacheStats
Cache statistics for monitoring.
LockFreeCacheStats
Statistics for the two-tier cache.
LockFreeLruCache
Lock-free two-tier cache with DashMap L1 and LruCache L2.
LruCache
Thread-safe LRU cache with O(1) operations.