Expand description
§Schema Cache
Opt-in in-memory cache for collection schema metadata (primary_key_alias, fields, version). Eliminates redundant schema API calls for ID extraction and field validation.
§Features
- LRU eviction: bounded memory — oldest entries evicted when capacity exceeded
- TTL expiry: entries go stale after configurable duration (default 5 min)
- Realtime invalidation:
handle_schema_changed()for WS/SSE push events - Thread-safe:
Mutex-protectedHashMap/VecDeque(low contention, no extra deps) - Fast guard when disabled: lookups and inserts short-circuit via
enabledflag
Structs§
- Cached
Schema - Cached schema metadata for a single collection.
- Schema
Cache - Thread-safe, opt-in schema cache with LRU eviction and TTL expiry.
- Schema
Cache Config - Configuration for the schema cache.