Open davies opened 2 years ago
@davies Is any one working on this issue now?
It seems to me the simplest way to add such a cache is to create a new ObjectStorage
with a field for cache and another for the actual storage. When options like cache-bucket
are set in command line along with bucket
options, we can create such a new ObjectStorage
.
But I'm not sure when should the cache be written. Since this issue mentioned that the cache should be a faster object store, after reading from the actual storage with Get(key string, off, limit int64)
, how can we cache the result in the cache store? Or maybe we just need a KV store API just like any other cache out there.
@suzaku There is PR as the proof of concept: https://github.com/juicedata/juicefs/pull/1364/files
Thanks.
The POC PR answers my first question, only Get(key, 0, -1)
calls are cached.
Will cache utilization be better if you add this remote cache at the CacheManager
layer instead of the ObjectStorage
layer?
The CacheManager will not cache the partial result from object store, so they are the same.
Make sense, thanks.
When the underlying object store is not fast enough, and the local disk is not big enough, we can setup a faster object store between them as the cache tier (read cache and write cache).
Some candidates: Redis or memcached compatible KV store.