If the data storage is not local (= for all backends except posixfs), borgstore could use an optional cache and use a backend (like posixfs) internally for cache storage.
Cache coherency is very important:
- it is quite easy if objects are named by their content hash: only presence vs. non-presence of object with a specified name. due to
name == hash(content), the content of some named object will never change, but could be deleted.
- for arbitrarily named objects: don't cache at all in first implementation. this should be no big problem, because this is usually small stuff, like a config or other metadata.
Cache eviction:
- in first implementation, do not evict anything from the cache
- later, a LRU based eviction could be used, separately configurable per namespace
Notes:
- the levels configuration of the cache and the server-side storage backend would be identical
- objects in the cache would have identical names as in the remote backend
- if the cache has unlimited size, it can provide a complete local mirror of the remote backend
- cache is only updated after we get a 200 OK response for the respective request to the server
- we have to expect multiple concurrent users updating the server-side backend independently
- list method could be uncached for simplicity
If the data storage is not local (= for all backends except posixfs), borgstore could use an optional cache and use a backend (like posixfs) internally for cache storage.
Cache coherency is very important:
name == hash(content), the content of some named object will never change, but could be deleted.Cache eviction:
Notes: