Open multani opened 5 years ago
If this feature is willing to be accepted, I'd be glad to propose a pull request to support that use case :+1:
Is the purpose of this to allow multiple applications with same namespace and same key to store in the same redis? I'm only concerned about consistency with the other namespace managers. Most of them don't allow to configure the prefix as it's an internal implementation detail.
@amol- Basically, yes the purpose is to have different applications using Beaker and the same namespaces/keys without conflicting with each other.
We also have a "monitoring" aspects, in the sense that we have some scripts running which are computing resource usage based on this initial prefix. We have other frameworks/languages using Redis and we configured them to store the "application name" (or something equivalent) as the initial key prefix ... which works well for our use cases, except for our Python applications which are all grouped under the same prefix. (I know it's probably better to use different Redis servers/databases to separate application concerns, but that may not be always possible for various reasons).
As for your concern regarding the other managers, I don't see it as a particular problem:
table_name
can be changedtable_name
can be changed
Currently, the
RedisNamespaceManager
prefixes all the keys withbeaker_cache:
.This should be a configurable parameter of the namespace manager, that would allow to use different instances of Beaker with different applications, without having to specify different databases. This may also help to distinguish "owners" of the keys, as instead of having
beaker_cache
has a prefix, it would be possible to put a more "application friendly" name.If not specified, the default value should stay with
beaker_cache
.