Expand description
Backend interface for cache implementors.
This module defines the trait that custom cache backends must implement,
along with the entry type they operate on. Most callers should
use LanceCache instead of interacting with
backends directly.
§Migrating custom backends
Cache keys are opaque 16-byte values. Store
InternalCacheKey::as_bytes directly instead of decomposing a logical
prefix, key string, and Rust type name. The physical namespace must also
include CACHE_KEY_FORMAT, so a future key
protocol produces cold misses instead of aliases. Persistent or tiered
backends can route serializable values with CacheCodec::type_id.
Prefix invalidation and key inventory are intentionally not part of this interface: one-way digests cannot support either operation without retaining the logical strings that fixed-size keys are designed to remove. Existing callers should migrate removed symbols as follows:
- replace
with_backend_and_prefix(backend, prefix)withLanceCache::with_backendfollowed byLanceCache::with_key_prefix; - replace
invalidate_prefixwithLanceCache::clearwhen clearing the shared backend is acceptable, or rotate a versioned namespace to leave older entries to age out; - remove uses of
prefix,keys, and session key-inventory methods; opaque keys have no readable or enumerable equivalent.
Traits§
- Cache
Backend - Low-level pluggable cache backend.
Type Aliases§
- Cache
Entry - A type-erased cache entry.