I need to use the in-memory cache for faster access but my use case is not big enough to opt any DB like dgraph or sql.
Could you please suggest any design pattern which I can implement to use ristretto as persistent cache. Simply Write/Read into a file while creating a key in ristretto or reading all keys if app restarts is an old school pattern. Could you please suggest anything else.
Badger with a sufficient block cache would help a lot. But, probably not get you all the way there — for that, Badger would need to serve a key directly from Ristretto, instead of from the block cache.
So, what you could do is, store data in Badger, and use Ristretto on top of it for caching — do also set decent cache within Badger.
@mrjn, Please correct me if I’m wrong. So what you’re suggesting that save the data using badger db in a persistent storage. Whenever application restarts, read the data from badger db and load in ristretto and then read it from cache. Am I correct?
If it is then my application already have a provision of bolt and bunt db. I think I can reuse them rather than adding badger.