go-redis/cache

newbie: trying to understand utility of this package compared to `redis/go-redis/v9`

Opened this issue · 0 comments

Hi - I am new to redis and am trying to understand the utility of this package compared to the go-redis/v9 client library. Is there a Slack channel/Google Group/other discussion forum where this question is better posed?

My understanding so far is that this is a higher level wrapper around the go-redis/v9 client library (or many other go redis client libraries actually) which provides cache-specific helper functions (whereas the general go-redis/v9 client is lower-level and can do much more). Some core features to me seem to be:

  1. Being able to store Go structs directly as the values in the redis key:value pair (Marshalling is abstracted away by this go-redis/cache lib
  2. The ability to use a local cache in-app to minimize network hops to the redis server + shield redis from deluge of requests.

Is my understanding so far correct?

Followup question:
3. Does the local cache referenced above implement client-side server-assisted caching as described in the Redis blog here? That is, is this local cache in sync with the redis data? Reading the source code, it definitely does not seem to be the case. Can you confirm? Could you describe from your perspective what the utility is for using this local cache if the invalidation option with this cache is limited to TTL (no server/event based invalidation).

Thanks so much!