12

I'd like two use at least two Heroku regions - US and EU. The goal is to give each user the server closest to them.

I know how to achieve this with AWS - Latency Based Routing.

Is LBR limited to 'pure AWS', or can it easily be applied to Heroku or hosting?

In any case, LBR only solves a part of the problem (end user --> web dyno). Is there a guide to working with Heroku databases / other resources cross regions?

ripper234
  • 222,824
  • 274
  • 634
  • 905
  • LBR only works with AWS ELBs – Neil Middleton Jul 01 '13 at 15:44
  • @NeilMiddleton - so ... what's the best solution for Heroku? Or don't you know of one? – ripper234 Jul 01 '13 at 16:16
  • there isn't one - for cross region keeping the database in sync is the biggest problem. – John Beynon Jul 01 '13 at 19:48
  • @JohnBeynon - of course there is one ... it's just complicated and perhaps no open source / accessible solution has done this. You can try sharding/replicating your data per user region, it depends on your problem. I mean - I can easily read me Gmail from the EU and the US. It's not an unsolved problem, it's just a hard problem. – ripper234 Jul 04 '13 at 00:30
  • 1
    @ripper234 he was talking about using Heroku to deploy across regions, not in general. – Eric Carmichael May 17 '17 at 20:49

1 Answers1

1

Yes, this is completely possible, you would need to choose the AWS region for each record that matches the Heroku region in question. e.g

foobar.example.org CNAME myuseast.herokuapp.com -> latency based us-east-1
foobar.example.org CNAME myeuwest.herokuapp.com -> latency based eu-west-1

This link explains how to find the regions, eu = eu-west-1, us = us-east-1 Where are Heroku apps hosted exactly?

It is important to consider that users who have similar pings to both US and EU data centres may get routed to one one day and the other the next.

This link explains that this is possible, I have also tried it in my own AWS account just now. https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-latency.html

OllyTheNinja
  • 566
  • 3
  • 16