Communication between service replicas
pawelblaszczyk5
HOBBYOP

3 months ago

I'm wondering about using Railway to deploy one of my service. It needs multiple stateful replicas and I'm using clustering solution for this. It requires for each replica to be addressable for communication within cluster. I've spotted that there's RAILWAY_REPLICA_ID which allows differentiating between replicas. Can this be used somehow for addressing them? Previously I've deployed this stuff on Fly.io and heavily used this: https://fly.io/docs/networking/private-networking/#fly-io-internal-dns

$10 Bounty

7 Replies

3 months ago

You can run an AAAA DNS lookup on the service's private domain and it will return each replicas' IP address.

image.png

Attachments


3 months ago

The IPv6 addresses also contain enough information to differentiate between replicas, let me check if there's any info on how you could recreate/assemble them couldn't find


pawelblaszczyk5
HOBBYOP

3 months ago

Thanks a lot! Is it somehow possible to match these to specific replica IDs?


3 months ago

I do not believe so, at least from what is documented (the AAAA DNS lookup isnt even documented, I just remembered a team member mentioning it previously).


3 months ago

You can always just query the IP's for their RAILWAY_REPLICA_ID.


pawelblaszczyk5
HOBBYOP

3 months ago

Thanks a lot for the help!


3 months ago

No problem!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...