Running the same site across 2 servers in different loactions

September 26, 2017 888 views
Networking Apache Configuration Management Deployment VPN Ubuntu 16.04

Hi All,

I am launching a new site and we are expecting a lot of traffic across the US as its a new version of our current one. We currently use a single server in New York for web and DB.

However I would like to have 2, now ideally I would like to have one the other side of the USA which digital ocean provides. But I am not sure how I would be able to distribute traffic between two web servers with the same domain name.

I am happy enough with ensuring that both are always in sync I have a pretty good plan for that. But making sure that someone close to one server gets a response from the nearest one not the other one

Is this at all possible, if it is how can I go about it. I currently have the single server as Ubuntu with VespaCP on top to run the site

Thanks

2 Answers

As far as I know you can use CDN's to serve static content from a source that is more local but the main application or website has to be in a single place. It may be possible and I would like to hear of it but I can imagine the complexities and really you will not notice such a big difference between coasts of the USA if you get caching and various things set right.

While it is easy to ask where the request is being asked of the server you determine this in your own code already on your server so it already made the journey one way. There must be technology with DNS that allows server IP's to be given in response depending on location but it is really not typical in my experience.

This is very interesting. Dont do it with CDN call it plan Z.
Please try this,
Have a list of IP address SAMPLE IS HERE [https://db-ip.com/db/](http://)
then have a page that judges the ip and relocate to the appropriate server.
I think the only down side that default page will be hit with every request.
Or have two domains. the default one and the other side of the world domain. A user always hits the defaults, but when he/she gets redirected to the other server, all the url are for that server and not the default.
the only downside you will have to re code that change.
let me know what you decided. If i be lucky enough i think will try that with my application rather than relay on CDNs.

Have another answer? Share your knowledge.