Say I have a client (a business, not a consumer) in US, for whom I set up a specific webserver + database instance in US. Only this db instance has this client's details. And suppose I have a client in the middle east, for whom I set up a specific webserver + database instance in Singapore. Only this client's details is stored in the Singapore server. And, the webservers are not stateless. That is, they hold the user login in their own redis instances (again, 2 redis instances corresponding to Singapore & US). Let's say my domain name is my-domain.com. Let's say the middle-east user goes to my-domain.com. Logs in to see that his login failed because he's accessing the US server where his credentials aren't there. And, the loadbalancer doesn't really know he's the middle-east user until his log in passes. I suppose the middle-east user could be accessing my-domain.com from US, for which the geoDNS would direct him to the US server. Right? What's the solution for this? And how do the big shots like amazon & google handle this?
Asked
Active
Viewed 25 times
0
-
1If you're setting up totally separate server/database for each customer, I'd just give 'em `customername.example.com` subdomains and direct them to them. – ceejayoz Sep 04 '18 at 20:23
-
@ceejayoz is there a way other than creating subdomains? I see that when such subdomains are created programmatically (when a user signs up for trial), the subdomain takes about 24 hours or so to get active due to dns propagation time. Right? And, how do the big guys do it. I don't see them having subdomains for different regions. – Srikanth Sep 04 '18 at 21:15
-
1You'd probably use a wildcard subdomain. (Plus, with proper TTLs, DNS "propagation" doesn't take 24 hours.) "The big guys" aren't firing up per-customer instances like you want to, and what "the big guys" do isn't usually applicable to the *small* guys, as it's generally very expensive and complicated. – ceejayoz Sep 04 '18 at 21:28
-
@ceejayoz Ok. Thanks for clearing that up. I guess the expensive & complicated way is to have replicated databases and webservers throughout the locations such that a user can login from any webserver. Is that a fair assumption? – Srikanth Sep 04 '18 at 21:45
-
Yes. The vast majority of companies don't need anything like that, and in many cases, a good CDN gets you 90% of the way there performance-wise. – ceejayoz Sep 04 '18 at 21:48
-
What happens when your clients each both go on a trip to Paris at the same time, and then try to access the DNS name? It won't work. DNS is global. – Michael Hampton Sep 04 '18 at 22:30
-
@MichaelHampton what are you suggesting? – Srikanth Sep 05 '18 at 06:25