Feature Store Cache
Định nghĩa
Feature Store Cache là cache layer dùng để phục vụ feature lookup latency thấp cho online prediction hoặc model serving.
Cách hiểu bằng lời của tôi
Feature store thường nằm trên hot path của inference. Nếu mỗi prediction phải đọc nhiều feature từ Redis hoặc store trung tâm, cost và latency tăng nhanh. Local/in-process cache có thể giảm request tới feature store, nhưng phải quan sát hit rate, memory, freshness và thread safety.
Lyft dùng DynamoDB làm source of truth cho online feature, ValKey làm write-through cache, rồi tối ưu payload, pod sizing, retry/timeout và TTL để giảm P95 latency. Snap đi xa hơn với một số ranking workload: document features được colocate trong memory của inference instance để tránh network fanout.
Cơ chế từ DoorDash
- Thêm in-memory pod-local cache trước Redis feature store.
- Dùng LRU để giới hạn memory.
- Đo latency, hit rate, cache size và memory usage.
- Cân nhắc Cache Warmup để tránh slow start khi service restart.
- Dùng event/Kafka để giữ feature mới hơn trong cache.
Trade-off
- Giảm latency và chi phí Redis.
- Tăng nguy cơ stale feature nếu invalidation/update không tốt.
- Local cache phân tán làm observability và consistency khó hơn.