Search code examples
node.jsrediskue

Can the same Redis instance be used manually alongside kue.js?


I am using kue.js, which is a redis-backed priority queue for node, for pretty straightforward job-queue stuff (sending mails, tasks for database workers).

As part of the same application (albeit in a different service), I now want to use redis to manually store some mappings for a url-shortener. Does concurrent manual use of the same redis instance and database as kue.js interfere with kue, i.e., does kue require exclusive access to its redis instance?

Or can I use the same redis instance manually as long as I, e.g., avoid certain key prefixes?

I do understand that I could use multiple databases on the same instances but found a lot of chatter from various sources that discourage the use of the database feature as well as talk of it being deprecated in the future, which is why I would like to use the same database for now if safely possibly.

Any insight on this as well as considerations or advice why this might or might not be a bad idea are very welcome, thanks in advance!


Solution

  • I hope I am not too late with this answer, I just came across this post ...

    It should be perfectly safe. See the README, especially the section on redis connections.

    You will notice that each queue can have its own prefix (default is q), so as long as you are aware of how prefixes are used in your system, you should be fine. I am not sure why it would be a bad idea as long as you know about the prefixes and load usage by various apps hitting the redis server. Can you reference a post/page where this was described as a bad idea ?