Highly Available and Scalable Environment for Hosting Static Websites on EC2 Instances

Create a Highly Available Environment for Hosting Static Websites on EC2 Instances

Prev Question Next Question

Question

You are planning to host a static website on EC2 Instances.

You need to ensure that the environment is highly available and scalable to meet demand.

Which of the below aspects can be used to create a highly available environment.

Choose 3 answers from the options given below.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - A, B and D.

The diagram below shows an example of a highly available architecture for hosting EC2 Instances.

Here you have the.

ELB is placed in front of the users which helps in directing the traffic to the EC2 Instances.

The EC2 Instances which are placed as part of an AutoScaling Group.

Then you have multiple subnets that are mapped to multiple availability zones.

The solution is to create several instances across several availability zones and to use an elastic load balancer to distribute the traffic and Auto Scaling group to scale the instances.

This way, even if an instance fails, you already have other ones available.

AWS recommends this solution as they have an SLA of 99.95% for their instance in an AZ.

By putting in several AZs, you can have 100% availability.

For a static web site, the SQS is not required to build such an environment.

If you have a system such as an order processing system, which has that sort of queuing of requests, then that could be a candidate for using SQS Queues.

For more information on high availability, please visit the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-increase-availability.html#scale-and-load-balance-prerequisites
I
] OnDemand. | :
[ae Spot Autoscaing Availability Zone B

To create a highly available and scalable environment for a static website hosted on EC2 instances, the following aspects can be used:

  1. Auto Scaling group: An Auto Scaling group can be used to automatically scale the EC2 instances based on the traffic or demand. It allows you to automatically add or remove EC2 instances in response to changes in demand. This ensures that the environment is highly available and can handle varying levels of traffic without any downtime.

  2. Elastic Load Balancer (ELB): An ELB can be used to distribute incoming traffic across multiple EC2 instances. This helps to balance the load and ensure that no single EC2 instance is overwhelmed with traffic. ELBs can also detect unhealthy instances and automatically route traffic to healthy instances, further increasing the availability of the environment.

  3. Multiple Availability Zones: Deploying EC2 instances in multiple Availability Zones (AZs) can provide high availability and fault tolerance. AZs are geographically distinct data centers within a region, each with independent power, cooling, and networking. By deploying EC2 instances in multiple AZs, you can ensure that your website remains available even if an entire AZ goes down.

  4. SQS queue: SQS is a message queuing service that enables decoupling and scalability of microservices, serverless functions and distributed systems. SQS can be used to scale the processing of messages or tasks within your application.

In summary, using Auto Scaling group, Elastic Load Balancer, and Multiple Availability Zones can help you create a highly available and scalable environment for hosting a static website on EC2 instances.