Web Application Hosting in The AWS Cloud: First Published May 2010
Web Application Hosting in The AWS Cloud: First Published May 2010
AWS Cloud
First Published May 2010
© 2021 Amazon Web Services, Inc. or its affiliates. All rights reserved.
Contents
An overview of traditional web hosting ...............................................................................1
Web application hosting in the cloud using AWS ...............................................................2
How AWS can solve common web application hosting issues.......................................2
An AWS Cloud architecture for web hosting ...................................................................4
Key components of an AWS web hosting architecture ...................................................6
Key considerations when using AWS for web hosting .....................................................16
Conclusion .........................................................................................................................18
Contributors .......................................................................................................................19
Further reading ..................................................................................................................19
Document versions ............................................................................................................19
Abstract
Traditional on-premises web architectures require complex solutions and accurate
reserved capacity forecast in order to ensure reliability. Dense peak traffic periods and
wild swings in traffic patterns result in low utilization rates of expensive hardware. This
yields high operating costs to maintain idle hardware, and an inefficient use of capital for
underused hardware.
Amazon Web Services (AWS) provides a reliable, scalable, secure, and highly
performing infrastructure for the most demanding web applications. This infrastructure
matches IT costs with customer traffic patterns in near-real time.
This whitepaper is meant for IT Managers and System Architects who want to
understand how to run traditional web architectures in the cloud to achieve elasticity,
scalability, and reliability.
Amazon Web Services Web Application Hosting in the AWS Cloud
Page 1
Amazon Web Services Web Application Hosting in the AWS Cloud
The following sections look at why and how such an architecture should be and could
be deployed in the AWS Cloud.
For example, the following graph shows a web application with a usage peak from 9AM
to 3PM, and less usage for the remainder of the day. An automatic scaling approach
based on actual traffic trends, which provisions resources only when needed, would
result in less wasted capacity and a greater than 50 percent reduction in cost.
Page 2
Amazon Web Services Web Application Hosting in the AWS Cloud
Page 3
Amazon Web Services Web Application Hosting in the AWS Cloud
In the AWS Cloud, you can provision testing fleets as and when you need them. This
not only eliminates the need for pre-provisioning resources days or months prior to the
actual usage, but gives you the flexibility to tear down the infrastructure components
when you do not need them. Additionally, you can simulate user traffic on the AWS
Cloud during load testing. You can also use these parallel fleets as a staging
environment for a new production release. This enables quick switchover from current
production to a new application version with little or no service outages.
Page 4
Amazon Web Services Web Application Hosting in the AWS Cloud
Page 5
Amazon Web Services Web Application Hosting in the AWS Cloud
Page 6
Amazon Web Services Web Application Hosting in the AWS Cloud
Network management
In the AWS Cloud, the ability to segment your network from that of other customers
enables a more secure and scalable architecture. While security groups provide host-
level security (see the Host security section), Amazon Virtual Private Cloud (Amazon
VPC) enables you to launch resources in a logically isolated and virtual network that
you define.
Amazon VPC is a service that gives you full control over the details of your networking
setup in AWS. Examples of this control include creating internet subnets for web
servers, and private subnets with no internet access for your databases. Amazon VPC
enables you to create hybrid architectures by using hardware virtual private networks
(VPNs), and use the AWS Cloud as an extension of your own data center.
Amazon VPC also includes IPv6 support in addition to traditional IPv4 support for your
network.
Content delivery
When your web traffic is geo-dispersed, it’s not always feasible and certainly not cost
effective to replicate your entire infrastructure across the globe. A Content Delivery
Network (CDN) provides you the ability to utilize its global network of edge locations to
deliver a cached copy of web content such as videos, webpages, images and so on to
your customers. To reduce response time, the CDN utilizes the nearest edge location to
the customer or originating request location to reduce the response time. Throughput is
dramatically increased given that the web assets are delivered from cache. For dynamic
data, many CDNs can be configured to retrieve data from the origin servers.
You can use CloudFront to deliver your website, including dynamic, static, and
streaming content, using a global network of edge locations. CloudFront automatically
routes requests for your content to the nearest edge location, so content is delivered
with the best possible performance. CloudFront is optimized to work with other AWS
services, like Amazon S3 and Amazon Elastic Compute Cloud (Amazon EC2).
CloudFront also works seamlessly with any origin server that is not an AWS origin
server, which stores the original, definitive versions of your files.
Like other AWS services, there are no contracts or monthly commitments for using
CloudFront – you pay only for as much or as little content as you actually deliver
through the service.
Page 7
Amazon Web Services Web Application Hosting in the AWS Cloud
Additionally, any existing solutions for edge caching in your web application
infrastructure should work well in the AWS Cloud.
Host security
In addition to inbound network traffic filtering at the edge, AWS also recommends web
applications apply network traffic filtering at the host level. Amazon EC2 provides a
feature named security groups. A security group is analogous to an inbound network
firewall, for which you can specify the protocols, ports, and source IP ranges that are
allowed to reach your EC2 instances.
You can assign one or more security groups to each EC2 instance. Each security group
allows appropriate traffic in to each instance. Security groups can be configured so that
only specific subnets, IP addresses, and resources have access to an EC2 instance.
Alternatively, they can reference other security groups to limit access to EC2 instances
that are in specific groups.
In the AWS web hosting architecture in Figure 3, the security group for the web server
cluster might allow access only from the web-layer Load Balancer and only over TCP on
ports 80 and 443 (HTTP and HTTPS). The application server security group, on the
other hand, might allow access only from the application-layer Load Balancer. In this
model, your support engineers would also need to access the EC2 instances, what can
be achieved with AWS Systems Manager Session Manager. For a deeper discussion
on security, the AWS Cloud Security, which contains security bulletins, certification
information, and security whitepapers that explain the security capabilities of AWS.
Page 8
Amazon Web Services Web Application Hosting in the AWS Cloud
Page 9
Amazon Web Services Web Application Hosting in the AWS Cloud
database services. Alternatively, you can deploy your own database software on an
EC2 instance. The following table summarizes these options, which are discussed in
greater detail in this section.
Amazon RDS
Amazon RDS gives you access to the capabilities of a familiar MySQL, PostgreSQL,
Oracle, and Microsoft SQL Server database engine. The code, applications, and tools
that you already use can be used with Amazon RDS. Amazon RDS automatically
patches the database software and backs up your database, and it stores backups for a
user-defined retention period. It also supports point-in-time recovery. You can benefit
from the flexibility of being able to scale the compute resources or storage capacity
associated with your relational database instance by making a single API call.
Amazon RDS Multi-AZ deployments increase your database availability and protect
your database against unplanned outages. Amazon RDS Read Replicas provide read-
only replicas of your database, so you can scale out beyond the capacity of a single
database deployment for read-heavy database workloads. As with all AWS services, no
upfront investments are required, and you pay only for the resources you use.
Page 10
Amazon Web Services Web Application Hosting in the AWS Cloud
When managing your own database software directly on Amazon EC2, you should also
consider the availability of fault-tolerant and persistent storage. For this purpose, we
recommend that databases running on Amazon EC2 use Amazon Elastic Block Store
(Amazon EBS) volumes, which are similar to network-attached storage.
For EC2 instances running a database, you should place all database data and logs on
EBS volumes. These will remain available even if the database host fails. This
configuration allows for a simple failover scenario, in which a new EC2 instance can be
launched if a host fails, and the existing EBS volumes can be attached to the new
instance. The database can then pick up where it left off.
EBS volumes automatically provide redundancy within the Availability Zone. If the
performance of a single EBS volume is not sufficient for your databases needs, volumes
can be striped to increase input/output operations per second (IOPS) performance for
your database.
For demanding workloads, you can also use EBS Provisioned IOPS, where you specify
the IOPS required. If you use Amazon RDS, the service manages its own storage so
you can focus on managing your data.
Non-relational databases
In addition to support for relational databases, AWS also offers a number of managed
non-relational databases:
Page 11
Amazon Web Services Web Application Hosting in the AWS Cloud
you don’t have to worry about hardware provisioning, setup and configuration,
replication, software patching, or cluster scaling.
• Amazon Neptune is a fast, reliable, fully managed graph database service that
makes it easy to build and run applications that work with highly connected
datasets. The core of Amazon Neptune is a purpose-built, high-performance
graph database engine optimized for storing billions of relationships and querying
the graph with milliseconds latency.
Additionally, you can use Amazon EC2 to host other non-relational database
technologies you may be working with.
Page 12
Amazon Web Services Web Application Hosting in the AWS Cloud
For attached file system-like storage, EC2 instances can have EBS volumes attached.
These act like mountable disks for running EC2 instances. Amazon EBS is great for
data that needs to be accessed as block storage and that requires persistence beyond
the life of the running instance, such as database partitions and application logs.
In addition to having a lifetime that is independent of the EC2 instance, you can take
snapshots of EBS volumes and store them in S3. Because EBS snapshots only back up
changes since the previous snapshot, more frequent snapshots can reduce snapshot
times. You can also use an EBS snapshot as a baseline for replicating data across
multiple EBS volumes and attaching those volumes to other running instances.
EBS volumes can be as large as 16TB, and multiple EBS volumes can be striped for
even larger volumes or for increased input/output (I/O) performance. To maximize the
performance of your I/O-intensive applications, you can use Provisioned IOPS volumes.
Provisioned IOPS volumes are designed to meet the needs of I/O-intensive workloads,
particularly database workloads that are sensitive to storage performance and
consistency in random access I/O throughput.
You specify an IOPS rate when you create the volume and Amazon EBS provisions that
rate for the lifetime of the volume. Amazon EBS currently supports IOPS per volume
ranging from maximum of 16000 (for all instance types) up to 64,000 (for instances built
on Nitro System). You can stripe multiple volumes together to deliver thousands of
IOPS per instance to your application. Apart from this, for higher throughput and
mission critical workloads requiring sub-millisecond latency, you can use io2 block
express volume type which can support up-to 256,000 IOPS with a maximum storage
capacity of 64TB.
The Auto Scaling service can create capacity groups of servers that can grow or shrink
on demand. Auto Scaling also works directly with Amazon CloudWatch for metrics data
Page 13
Amazon Web Services Web Application Hosting in the AWS Cloud
and with Elastic Load Balancing to add and remove hosts for load distribution. For
example, if the web servers are reporting greater than 80 percent CPU utilization over a
period of time, an additional web server could be quickly deployed and then
automatically added to the load balancer for immediate inclusion in the load balancing
rotation.
As shown in the AWS web hosting architecture model, you can create multiple Auto
Scaling groups for different layers of the architecture, so that each layer can scale
independently. For example, the web server Auto Scaling group might trigger scaling in
and out in response to changes in network I/O, whereas the application server Auto
Scaling group might scale out and in according to CPU utilization. You can set
minimums and maximums to help ensure 24/7 availability and to cap the usage within a
group.
Auto Scaling triggers can be set both to grow and to shrink the total fleet at a given layer
to match resource utilization to actual demand. In addition to the Auto Scaling service,
you can scale Amazon EC2 fleets directly through the Amazon EC2 API, which allows
for launching, terminating, and inspecting instances.
The infrastructure protection services in particular help with your defense strategy:
• AWS Shield is a managed DDoS protection service that helps safeguard against
various forms of DDoS attack vectors. The standard offering of AWS Shield is
free and automatically active throughout your account. This standard offering
helps to defend against the most common network and transportation layer
attacks. In addition to this level, the advanced offering grants higher levels of
Page 14
Amazon Web Services Web Application Hosting in the AWS Cloud
protection against your web application by providing you with near real-time
visibility into an ongoing attack, as well as integrating at higher levels with the
services mentioned earlier. Additionally, you get access to the AWS DDoS
Response Team (DRT) to help mitigate large-scale and sophisticated attacks
against your resources.
It’s important to ensure that there are provisions for migrating single points of access
across Availability Zones in the case of failure. For example, you should set up a
database standby in a second Availability Zone so that the persistence of data remains
consistent and highly available, even during an unlikely failure scenario. You can do this
on Amazon EC2 or Amazon RDS with the click of a button.
Page 15
Amazon Web Services Web Application Hosting in the AWS Cloud
While some architectural changes are often required when moving an existing web
application to the AWS Cloud, there are significant improvements to scalability,
reliability, and cost-effectiveness that make using the AWS Cloud well worth the effort.
The next section discusses those improvements.
Firewalls everywhere
Where you once had a simple demilitarized zone (DMZ) and then open communications
among your hosts in a traditional hosting model, AWS enforces a more secure model, in
which every host is locked down. One of the steps in planning an AWS deployment is
the analysis of traffic between hosts. This analysis will guide decisions on exactly what
ports need to be opened. You can create security groups for each type of host in your
architecture. You can also create a large variety of simple and tiered security models to
enable the minimum access among hosts within your architecture. The use of network
access control lists within Amazon VPC can help lock down your network at the subnet
level.
Page 16
Amazon Web Services Web Application Hosting in the AWS Cloud
When a new host is brought up, you shouldn’t make assumptions about the IP address
or location within an Availability Zone of the host. Your configuration model must be
flexible, and your approach to bootstrapping a host must take the dynamic nature of the
cloud into account. These techniques are critical for building and running a highly
scalable and fault-tolerant application.
Page 17
Amazon Web Services Web Application Hosting in the AWS Cloud
• AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web
applications and services developed with Java, .NET, PHP, Node.js, Python,
Ruby, Go, and Docker on familiar servers such as Apache, NGINX, Passenger,
and IIS. You can simply upload your code, and Elastic Beanstalk automatically
handles the deployment, capacity provisioning, load balancing, automatic
scaling, and application health monitoring. At the same time, you retain full
control over the AWS resources powering your application and can access the
underlying resources at any time.
• AWS App Runner is a fully managed service that makes it easy for developers
to quickly deploy containerized web applications and APIs, at scale and with no
prior infrastructure experience required. Start with your source code or a
container image. App Runner automatically builds and deploys the web
application and load balances traffic with encryption. App Runner also scales up
or down automatically to meet your traffic needs.
• AWS Amplify is a set of tools and services that can be used together or on their
own, to help front-end web and mobile developers build scalable full stack
applications, powered by AWS. With Amplify, you can configure app backends
and connect your app in minutes, deploy static web apps in a few clicks, and
easily manage app content outside the AWS Management Console.
Conclusion
There are numerous architectural and conceptual considerations when you are
contemplating migrating your web application to the AWS Cloud. The benefits of having
a cost-effective, highly scalable, and fault-tolerant infrastructure that grows with your
business far outstrips the efforts of migrating to the AWS Cloud.
Page 18
Amazon Web Services Web Application Hosting in the AWS Cloud
Contributors
The following individuals and organizations contributed to this document:
Further reading
• Deploy Django-based application onto Amazon LightSail
Document versions
Date Description
August 20, Multiple sections and diagrams updated with new services, features,
2021 and updated service limits.
Page 19
Amazon Web Services Web Application Hosting in the AWS Cloud
Date Description
September Updated icon label for “Caching with ElastiCache”
2019
July 2017 Multiple sections added and updated for new services. Updated
diagrams for additional clarity and services. Addition of VPC as the
standard networking method in AWS in “Network Management.”
Added section on DDoS protection and mitigation in “Additional
Security Features.” Added a small section on serverless
architectures for web hosting.
Page 20