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

Allow for user specified Redis key prefix #436

Open
ipmb opened this issue Mar 7, 2024 · 3 comments
Open

Allow for user specified Redis key prefix #436

ipmb opened this issue Mar 7, 2024 · 3 comments

Comments

@ipmb
Copy link

ipmb commented Mar 7, 2024

In multi-tenant scenarios, Redis recommends using namespaces to segment tenants. This is especially useful for non-production environments with hosted Redis providers. Instead of paying for a new Redis instance for each environment, the key space can be segmented and assigned to an environment.

This issue is to request the ability to define an arbitrary key prefix or namespace that would allow 2 arq services to operate on a single Redis instance/cluster.

Some prior art:

@rossmacarthur
Copy link

Could you explain why the queue_name option is not sufficient?

@ipmb
Copy link
Author

ipmb commented Mar 13, 2024

The prefix would need to be applied to every key in Redis. It's not clear to me that queue_name will be used for all these values?

arq/arq/constants.py

Lines 1 to 6 in ab2dda2

default_queue_name = 'arq:queue'
job_key_prefix = 'arq:job:'
in_progress_key_prefix = 'arq:in-progress:'
result_key_prefix = 'arq:result:'
retry_key_prefix = 'arq:retry:'
abort_jobs_ss = 'arq:abort'

@epicwhale
Copy link

+1 I faced the same issue too when having two separate worker codebases use the same redis db. The queue name prefix applied to only a small subset of keys generated. So it was hard for me even while using a redis gui browser (like redis insights) to figure out which entries belonged to which. A clean name spacing separation at the root level would be more ideal.

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

3 participants