Skip to content

Question: Does Spring Data Redis Support Runtime Multi-Tenancy for Redis Key Prefixing? #3130

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

Open
srosio opened this issue Apr 7, 2025 · 0 comments
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@srosio
Copy link

srosio commented Apr 7, 2025

Hi Spring Data Redis Team,

I’m working on a multi-tenant application using Redis, and I need to ensure that Redis keys are prefixed with the tenant context (e.g., tenantA:User:123) to isolate data per tenant. However, I’ve been struggling with managing key prefixing through custom solutions, and it’s proving to be error-prone and difficult to maintain across various Redis operations.

My Question:

  • Does Spring Data Redis have built-in support for runtime multi-tenancy or a way to automatically apply tenant-aware key prefixing across all Redis operations (e.g., SADD, SMEMBERS, HSET, etc.) based on the current tenant context?
  • If not, is there an existing recommended approach to achieve this that doesn’t require extensive manual configuration or custom serializers?

I believe this functionality would be very beneficial for multi-tenant applications, and I would appreciate any advice or resources on how to implement this more effectively.

Thank you for your time and assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants