Multi-region hosting with failover is a hardware redundant system designed to eliminate single points of failure. It includes redundant hardware, networking, bandwidth and DNS services. Files are synchronized from a primary location and the database nodes are clustered together. If a region experiences a service interruption, traffic is automatically rerouted. In addition to maximizing uptime, there are other reasons clients chose this configuration. Amazon Web Services (AWS) Route 53 DNS can be configured to direct traffic to the geographic region with the lowest latency. For example, an commerce website operates in South Korea and Northern Virginia. Visitors in Asia are directed to the South Korean presence while Europeans are directed to the Northern Virginia region. Businesses requiring the ability to scale up website resources can accomplish this with the multi-region setup. Instead of directing all traffic to one region, you can direct it into other regions.
Infrastructure services are provided by Amazon Web Services (AWS). There are four primary systems at work in the multi-region setup:
OpenVZ containers
An OpenVZ container with a CentOS 7.x installed operating system. It contains standard packages for web deployment including Apache Web Server, PHP and MySQL. There are two containers per region. The first container is a web server. The second container is a database node.
File Synchronization
One region is chosen to be the primary. Files are synchronized in real-time from primary region to the secondary region. A program named Lsyncd monitors the file system and creates a batch of changes to transmit to the secondary regions.
MySQL Galera Database
MySQL Galera is a database cluster system employing a minimum of three nodes. In a standard two-region system, a third region is added to support the third database node. Changes to the database node in one region automatically updates all other database nodes. Galera database cluster is self-healing. An interruption in service of a database node forces a reroute of traffic to another region.
AWS Route 53 DNS
In addition to the standard DNS functions of the registrar, Route 53 can detect an interruption in service and reroute all traffic to the other region. In addition, Route 53 will direct visitors to the region with the lowest latency. For example, visitors living in Germany would be directed to a European location while visitors in Ohio would be directed to Northern Virginia.