Is it possible to connect to redis from one environment to another?
ndeloney0
PROOP

a year ago

Hi,

I have a use case where I can only publish data to redis from one service in one environment, but want to consume the data from that redis instance from multiple services across multiple environments.

Essentially, is it possible to have redis run in Environment A and connect to that same redis in Environment B under the same project?

Solved

6 Replies

a year ago

Hello,

Yes this can be done, you would need to connect to Redis publicly.

Best,

Brody


Status changed to Awaiting User Response Railway about 1 year ago


ndeloney0
PROOP

a year ago

Hi Brody,

So this cannot be done via private network and must be exposed to public internet & subsequently charged for egress?


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

That's correct, the private network is scoped to each environment.


Status changed to Awaiting User Response Railway about 1 year ago


ndeloney0

Hi Brody,So this cannot be done via private network and must be exposed to public internet & subsequently charged for egress?

That is correct; Private Networks are scoped to an environment within a project. Read more about Private Networking in the Docs. Its best practice is to run connected services in the same environment. What's your use case for running your connected services across environments?


ndeloney0
PROOP

a year ago

I see - @christian, my use case has to do with ingesting data via a particular websocket that can only accept 1 maximum connection at a time. In order to share the data across multiple services, I republish the data through redis in the private network. However, since the websocket only accepts one connection I can't stream data to a redis in a different environment since the connection is already occupied from a different environment

Thus, I would ideally like a centralized redis that can be accessed from any environment in the private network.

I suppose I could always have an environment that just runs a public redis / websocket service and then listen to messages from that environment in each of my other environments, but then I also need another redis in each environment for those environments to have their own pub/sub system.

I understand that this is not really Railway's problem, however, it would be great if there was a solution for some sort of environment sharing for this type of use case without having to connect to redis publicly. Maybe there's an easier way I'm not seeing?


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

Hello,

We have no plans to support cross project private networking.

If you need a central Redis database, you would need to connect to it over the public network.

Best,

Brody


Status changed to Awaiting User Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Loading...