[feature] Disk-backed read and write through cache (EBS or local disk)
Today caching is memory only. That caps how much hot data we can keep close to the node, and cold reads go straight to object storage (higher latency and limited by S3 RPS for massive fanout).
Add a disk tier (EBS volume or local NVMe) that sits between memory and S3:
- Write through (Optional): data lands on disk on the way to object storage, so recent data is readable locally without an S3 round trip
- Read through (A need): object fetches from S3 get cached on disk, so repeated reads of the same range are cheap
- Memory stays the first tier, disk is the second, S3 is the source of truth
Things to figure out:
- Caching and Eviction policy and a size cap for the disk tier
- How this interacts with the existing block cache
The BlockCache is already extensible and can easily extend a layer add-on for MemoryBlockCache.
Consider use foyer
@shaeqahmed Exactly what I had in mind, while looking for a cachelib alternative in rust. And hybrid cache model is a clean fit here, saves much of work to implement an hybrid model.
Use https://nestor.picomq.com/