Redundancy on the Data Center Level
Problem to Be Solved
While you can apply the Multi-Server Pattern to improve availability when thinking about a server failure, the Multi-Server Pattern cannot handle a case where one envisions a data center-level failure (such as when there is a power outage, an earthquake, a network failure, or the like).
When you consider failures on the data center level, you will need to use multiple data centers. However, securing multiple data centers that are adequately far apart from each other, and purchasing physical hardware to provide redundancy in their systems, is extremely costly. On top of this, procurement and set up is also time-consuming, and from a cost effectiveness perspective, this is often difficult to achieve.
Another factor making this difficult to achieve is that improving availability involves more than merely setting up multiple data centers – you also need high-speed dedicated communication lines in consideration of data synchronization and communication between the data centers.
Explanation of the Cloud Solution/Pattern
Multiple data centers provide the Amazon Cloud services, and usually dedicated lines are connected between the individual data centers. You can specify the data center to be used, to structure systems (using virtual servers) in each of the data centers depending on your load. This allows you to structure systems that are distributed across multiple data centers more easily and less expensively than in the past. This makes it possible are you to create a system that can withstand even catastrophic events and data center-level failures.
Amazon Web Services (AWS) has multiple data centers, known as Availability Zones (AZ), in regions such as Tokyo and Singapore. Select the AZ to use and specify the AZ for locating each EC2 instance. The AZs are connected to each other through high-speed dedicated cables, making it possible to structure systems that span multiple AZs.
The implementation is essentially identical to that of the Multi-Server pattern. The difference is that when locating the EC2 instances, you can select different AZs when launching the instances. Because the Elastic Load Balancing (ELB) is structured automatically spanning multiple AZs, you do not need to worry about the load balancing. Moreover, this exists not just on the web layer, but on the database layer as well, in a structure that spans multiple AZs in all layers.
- You can structure a system that will continue to provide service even when there is a major failure on the data center level.
- This makes it possible for you to configure, quickly and inexpensively, the type of Disaster Recovery (DR) structure that has been the goal since the Great Eastern Japan Earthquake.
- Because in AWS there are neither initial setup fees nor monthly use fees for each individual AZ, there is no difference in your cost regardless of whether you use a single AZ or multiple AZs.
- Note that when databases are used in a master-slave configuration, the master will be located in one of the AZs. The AZs are connected to each other through high-speed dedicated cables, but the speed will be less than that of communication within and AZ. Use caution to prevent the speed of communication between AZs from becoming a bottleneck.
- If you are worried about the speed of communication between AZs, you can use an application or middleware such as HAProxy to communicate with an EC2 instance within the same AZ, and then, in the event of a failure of that EC2 instance, change the setup so as to communicate with an EC2 instance in another AZ. <ref group="Related Blog"> Template:Related Blog </ref>
- To achieve high fault tolerance, you need to locate the required numbers of servers redundantly in each individual AZ. For example, if you need three servers, then it will not be possible to handle the load when there is a failure in one of the AZs unless you locate three servers in each of the AZs.
- As of April 2012, Elastic Load Balancing (ELB) does not support redundant structures that span regions.
- When you use multiple AZs you will have to pay for the communication between the AZs, but the cost is low (at US$0.01 per gigabyte as of April 2012), so fundamentally we recommend that you use the Multi-Datacenter Pattern when setting up a redundant structure that uses multiple servers.