4

I'm hoping this isn't so open ended that it veers towards a "discussion" more than an "answerable" question.

I need to place an RDS Postgres instance in an AWS region that will act as the master DB for writes from all other regions. Those regions will include Australian and European regions, as well as North American.

My concern is latency on writes. I will use replicas for reads, so that is not so much a concern.

I will be using interregion VPC peering for all regions to be able to communicate with the RDS instance.

I'm thinking that placing the RDS server in us-west-2 as it seems to be in the most "central" spot for all regions of concern.

I understand that the AWS "backbone" is very fast, and perhaps fast enough not for this to be a concern.

Has anyone dealt with this problem and have any metrics or other ways to quantify a decision on where to place this RDS instance?

030
  • 13,235
  • 16
  • 74
  • 173
Chris
  • 151
  • 2
  • You should, of course, design the application so that you can easily change this if the theoretical calculations don't align with reality... but this does seem like a question with an objective solution. Can you list the specific regions where you're planning to deploy? – Michael - sqlbot Jun 27 '18 at 12:18
  • 1
    Remember also that RDS will only manage 5 replicas of a Postgres instance. Unlike with MySQL and MariaDB, RDS apparently won't let you work around this using cascaded/subtended replicas. – Michael - sqlbot Jun 27 '18 at 12:19
  • Thanks @Michael-sqlbot, I am planning to deploy the master RDS into us-west-2, with read replicas and web server instances running in ap-southeast-2 and eu-central-1. I understand the open ended-ness of this, but having not created this specific setup before, I figure any information I can gather the better. The design will allow me to change the RDS region for the master if required. – Chris Jun 28 '18 at 01:15
  • 1
    I've collected a matrix of cross-region latency data for a project I've been working on... I'll plan to look at that model tomorrow and see what it thinks about the selection of us-west-2 for this scenario, or whether it recommends something different. – Michael - sqlbot Jun 28 '18 at 01:26
  • 2
    Something else to consider is that depending on the nature of the writes to the db, it can also make sense to shift some of the latency burden away from the app... e.g. app in ap-southeast-2 hands off the write to SNS in the same region, which asynchronously invokes Lambda cross-region, which does the DB update. The propagation time is higher, but the app doesn't have to wait for the write to complete. Obviously this is only suitable for non-critical writes, but it's a thought. – Michael - sqlbot Jun 28 '18 at 01:33
  • 1
    Nice... My model agrees that us-west-2 is the best choice, followed by us-west-1, us-east-2, then eu-central-1. The logic I used is slightly tricky to explain, but it is based on which region would be the closest, then the next closest, then the next closest, from each of your three... us-west-2 is its own 0th preference, of course; eu-central-1 has 6 regions closer than us-west-2, and ap-southeast-2 has 8 regions closer than us-west-2, but (0 + 6 + 8) / 3 is still a smaller (better) possible result of any other combo, even if we allow for the db itself to be in a region other than these 3. – Michael - sqlbot Jun 29 '18 at 00:06
  • @Michael-sqlbot I can't thank you enough for looking at this for me. Sounds like you've really put thought into your model, and I'll accept this information as enough rationale to start off with those regions. If you wanted to put your comment there into an answer, I'll accept it and perhaps it will help the next person in a similar situation. Thanks very much! – Chris Jun 29 '18 at 02:02
  • Thanks... I'm trying to think of a way to transform it into an answer that would be useful to others. I'll see what I can come up with. – Michael - sqlbot Jun 29 '18 at 09:57
  • @Michael-sqlbot Could you post an answer? – 030 Dec 23 '19 at 10:29
  • 1
    @030 I can offer my experiences since asking the question, albeit it's a subjective view as I have no quantitative data. I can offer that a year and a half later, I haven't regretted my decision putting the master into us-west-2. Our users in any region don't seem to be impacted by having the master in us-west-2, at least from a UX perspective. I suppose at some point it could be worth measuring write times -- but to date I haven't had to. There's no business impact from any latencies due to the location of the master, that we can detect at least, so we're happy here. – Chris Dec 23 '19 at 15:05
  • @Chris Could you post this comment as an answer? – 030 Dec 24 '19 at 12:52
  • Sure @030 I've done this now. I won't mark as the correct answer though as I think some kind of metric based answer would be ideal. – Chris Dec 25 '19 at 09:08
  • @Chris Ok. Thanks for posting an answer. – 030 Dec 25 '19 at 09:15
  • 1
    @030 sorry I haven't gotten back with an answer, yet. I'm trying to make it relevant to the general audience and explain how I modeled this. – Michael - sqlbot Dec 26 '19 at 01:58

1 Answers1

1

It's been a while since posting the question, and a comment I made above seems to be helpful despite the fact it's using a quantitative assessment, so I'll post it here as an answer.

As per comment above:

@030 I can offer my experiences since asking the question, albeit it's a subjective view as I have no quantitative data. I can offer that a year and a half later, I haven't regretted my decision putting the master into us-west-2. Our users in any region don't seem to be impacted by having the master in us-west-2, at least from a UX perspective. I suppose at some point it could be worth measuring write times -- but to date I haven't had to. There's no business impact from any latencies due to the location of the master, that we can detect at least, so we're happy here

Chris
  • 151
  • 2