Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-side cache #43

Open
zuiderkwast opened this issue Mar 19, 2021 · 0 comments
Open

Client-side cache #43

zuiderkwast opened this issue Mar 19, 2021 · 0 comments

Comments

@zuiderkwast
Copy link
Collaborator

Redis supports client-side caching. How can we support it?

Firstly, all client instances to the same Redis node (i.e. one connection pool) must share the cache, so it won't work to have a cache per connection in the underlying eredis process.

Instead eredis needs to forward the invalidations to the cluster client. I guess a callback-based solution in eredis would be best for this, e.g. a config {invalidate_cache_callback, fun()}.

If RESP3 is used, we can get off-band invalidations in the same connections as the (GET, SET, etc.) commands. Otherwise, a dedicated subscription process is needed.

For the caching, I see two possibilities:

  1. Use an ETS table and handle invalidations by deleting from the table.
  2. Use a callback interface, to let the application handle the caching. This would be similar to what we need to do for eredis.

For the tracking of keys, there are multiple variants and this needs to be investigated futher. (TODO: Update this issue with more info.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant