Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation and geo-based server-selection. #36

Open
jvilhuber opened this issue May 18, 2020 · 2 comments
Open

Geolocation and geo-based server-selection. #36

jvilhuber opened this issue May 18, 2020 · 2 comments

Comments

@jvilhuber
Copy link
Contributor

jvilhuber commented May 18, 2020

Requirement: Need to be able to send an EU citizen to an EU servers, and US citizens to US servers.

One idea is to use geolocation DNS lookups on CNAME, which amazon supports:

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-geo.html

Location
When you configure Route 53 to respond to DNS queries based on the location that the queries originated from, select the continent or country for which you want Route 53 to respond with the settings in this record. If you want Route 53 to respond to DNS queries for individual states in the United States, select United States from the Location list, and then select the state from the Sublocation list.

(see also https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-geo)

The idea is: Client does a DNS CNAME lookup for, for example, morphic.org (or whatever we want to call the server URL). in the US, "CNAME morpic.org" would return "us.morphic.org" and in the EU it would return "eu.morphic.org". The client then saves this, and makes all subsequent API calls to that server.

Note:

  1. all API calls for the duration of this user-installation will go to the saved server. if the user is in the US when they first register, they will use the US server forever, unless they unregister and re-register in the EU (for example).
  2. If the user reformats the hard-drive, and re-installs, but is now in the EU, the CNAME lookup would now point to the EU server, but the EU server would not know their username/password nor their settings (those are on the US server). This would be confusing to the user, so we'd need some solution to that problem, perhaps. Perhaps the user could then be prompted "Where were you when you first signed up" or something.
@jvilhuber
Copy link
Contributor Author

jvilhuber commented May 18, 2020

Another idea is to have special "EU builds" and "US Builds" and "China builds" which have the server-list to talk to baked in. Doable, but not nearly as elegant and we'd have to build them all (and test them all)

@GreggVan
Copy link

GreggVan commented Jun 10, 2020

A simple suggestion from Antranig was as follows. (but if error in thought below it is mine)

  • each user as a GUID to identify them.
  • When the person signs up - they CHOOSE the server they want to use to store and process their preferences. (e.g. UnitedStates, Canada, Europe, etc.)
  • We the assign them a GUID with a PREFIX (eg. CA.af0bce26-ab27-11ea-bb37-0242ac130002
  • Then when a person 'keys in' you strip off the prefix and append it to morphic URL to create the address to send the GUID for processing (e.g. ca.morphic.org)
  • The nameservers will then automatically route the requests directly to the server anywhere.

ADVANTAGES

  1. All the servers to operate independently.
  2. They can all be identical to each other (except for user data which is unique to each).
  3. No user data flows anywhere except between the user's server and the local client.
  4. It works for users who are traveling but want their data processed on home cloud machines
  5. Allows users to choose country where they feel their data is safest
  6. It is simplest for us to code. No routing or processing needed. No central registry needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants