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
Add support for key prefixes #607
Comments
prefix is needed if multi project use a same redis-server |
also need |
I do think this should be done in your application level, not in basic redis client level var (
prefix string = "AAA_"
)
func Key(s string)string{
return prefix + s
}
// then
redisClient.Get(Key(xxx)) |
This would be useful for multi tenancy application too |
+10086 |
need |
it would be useful for multi micro service, when they are use the same redis cluster too |
need |
This would also be excellent for my use case! When using non-clustered redis, it is trivial to switch between logical databases. However, clustered redis makes it difficult for multi-tenancy within the same redis instance, which would be excellent to implement at the client level rather than in application code. |
你好,你的邮件我已收到
|
we need it |
We just ran into this as well; the redis client should support selecting a key prefix. Another reason why redis databases are not cutting it (other than them being deprecated) is around ACL. I can define multiple users in my redis cluster and provide different access e.g. by using an access string like This allows me to have multiple users on the same redis instance with separated access rights. Other redis clients, e.g. https://www.npmjs.com/package/ioredis are implementing this feature as well |
need |
your own code works well. |
你好,你的邮件我已收到
|
Absolutely needed. There is a common practice to use the same redis cluster around multiple microservices. Especially we had to make a wrapper to use key prefixes as "namespaces", but now it requires additional work for keeping the wrapper up to date with redis library and generally looks weird in usage as it still also needs some user-land code that constructs the key and then passes it to redis client methods. |
Reviving this issue: #563
SELECT
doesn't work with clustered Redis, so it's not an appropriate replacement for key prefixing in that case.The text was updated successfully, but these errors were encountered: