I have a MapState where the keys are Instants (with nano precision), and in my use case I need to retrieve all of the keys that are within a period.
My code to day is to iterate all keys and filter out those that I don't need, so I was thinking I could keep a cache with all the keys I've saved so I can issue get calls instead of using keys, since my backend is RocksDB.
The question is: to make sure that the cache reflects the state, or at least doesn't miss anything, is it enough to initialize it in the open function and then have it write-through to the backend? I need to be 100% sure that if a key exists in the state is for sure in the cache.