Search code examples
amazon-web-servicesaws-global-accelerator

Cross-region Read Replicas vs One Read Replica with AWS Global Accelerator


I would like to know what is more recommended when one DB instance should be shared across different AWS regions? Is it better to use cross-Region Read Replicas or to use Read Replica in region of origin + AWS Global Accelerator?

Is there some "best praxis solution" for global applications?

I am not experienced with AWS and the most of the things are pretty new for me. So I know that my question may look amateur.

From what I read, I think that one centralized Read replica is better solution, due to latency between regions, but if that would be a case, why anyone would use cross-region replicas at all?


Solution

  • If your application is hosted in a region e.g. eu-west-1 the best read performance will always come when it is reading data from eu-west-1.

    If you happen to have customers in us-east-1 you have to choose between one of 3 options:

    Edge Location

    You reduce the latency using edge locations, i.e. CloudFront or Global Accelerator. This will improve the latency by using the AWS Backbone to route to your origins. This is faster than previously but the application remains in the original region (in this case eu-west-1). You also maintain one copy of the application only.

    Latency based routing

    This option brings the application closer to the user, by using either Route 53 with latency based records or Global Accelerator you can have your domains resolve to the location that has the lowest latency for them. You would have your central region (where the readwrite lives) and then create cross region replicas. This will provide the best read performance as the reads are being done locally (rather than being across region).

    In the example eu-west-1 is the primary region with cross region replicas in us-east-1. Latency between regions is only observed with the time it takes to write to the readwrite (in the original region unless you use Aurora Read Replica Write Forwarding). This is by far the most complex and costly, but will provide the best performance overall.

    Do nothing

    If you do nothing this option will use the public internet to route to a host, those who are further away to your application will have a longer latency, but this is the cheapest option.

    Summary

    You need to essentially decide on the importance of cross region, if it is simply because your user base is in a further away region then ensuring you're as close to them as possible is key. You would not need to think about replicas if you're in a specific geographical region.

    Remember you can always enhance your infrastructure when demand increases from other geographical regions.