bullMQ & redis questions
baandaattopanga
PROOP

2 months ago

Hi Railway Team,

I'm currently learning and implementing a background job system using BullMQ and Redis for a Node.js application. I have everything working locally and am now trying to understand how the same setup should work when deployed on Railway.

I had a few questions about the recommended setup:

  1. Is there a recommended tutorial or documentation for running BullMQ with Redis on Railway?
  2. In local development we connect to Redis like this:
connection: {
  host: "127.0.0.1",
  port: 6379
}

What does the equivalent Redis connection configuration look like when using Railway's hosted Redis?

  1. Are Redis instances shared across projects, or can we allocate a dedicated Redis instance for our application?
  2. Our system uses multiple environments (QA, Stage, Production). Is it recommended to create separate Redis instances for each environment?
  3. For monitoring Redis activity (queues, keys, memory usage, etc.), is this typically done through the Railway dashboard, or can external tools like Redis Insight connect to Railway-hosted Redis?

Any guidance or best practices would be really helpful as we move from local development to deployment.

Thanks very much for your help.

Best,

JC

Solved$10 Bounty

Pinned Solution

ilyass012
FREE

2 months ago

Hey jon carlo, for your bullmq connection on railway the main thing you need to know is you must add family: 0 to your connection object, this is documented on railway's own library configuration page and without it your connection will fail on their network. so instead of hardcoding 127.0.0.1 and 6379 you just use the env variables railway gives you automatically which are REDISHOST, REDISPORT, REDISUSER, REDISPASSWORD and REDIS_URL, just reference those in your connection object alongside family: 0 and you're good.

for your other questions, each redis instance you add on railway is its own dedicated service, not shared with other projects. for external monitoring tools like redisinsight, railway supports external connections through their tcp proxy which is on by default, you just use the public host and credentials, though note that network egress is billed when using it.

for the multi-environment question and tutorials, i'd point you directly to these two official railway docs pages since they cover exactly your use case: docs.railway.com/guides/redis and docs.railway.com/networking/private-networking/library-configuration

1 Replies

Railway
BOT

2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway 2 months ago


ilyass012
FREE

2 months ago

Hey jon carlo, for your bullmq connection on railway the main thing you need to know is you must add family: 0 to your connection object, this is documented on railway's own library configuration page and without it your connection will fail on their network. so instead of hardcoding 127.0.0.1 and 6379 you just use the env variables railway gives you automatically which are REDISHOST, REDISPORT, REDISUSER, REDISPASSWORD and REDIS_URL, just reference those in your connection object alongside family: 0 and you're good.

for your other questions, each redis instance you add on railway is its own dedicated service, not shared with other projects. for external monitoring tools like redisinsight, railway supports external connections through their tcp proxy which is on by default, you just use the public host and credentials, though note that network egress is billed when using it.

for the multi-environment question and tutorials, i'd point you directly to these two official railway docs pages since they cover exactly your use case: docs.railway.com/guides/redis and docs.railway.com/networking/private-networking/library-configuration


Status changed to Solved sam-a 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...