Leo Zhadanovsky, Senior Solutions Architect at Amazon Web Services, shows how to run content management systems such as Drupal, WordPress and Jekyll on Amazon Web Services in a way that is scalable, highly-available and economical.
The slides feature how to architect websites in the cloud so they are secure and allow for rapid iteration and change without downtime.
2. Compute
EC2
Virtual servers in the cloud
Elastic Compute Cloud
• Resizable compute capacity in over 30 instance types
• Reduces the time required to obtain and boot new server instances to minutes
or seconds
• Scale capacity as your computing requirements change
• Pay only for capacity that you actually use
• Choose Linux or Windows
• Deploy across Regions and Availability Zones for reliability
• Support for virtual network interfaces that can be attached to EC2 instances in
your VPC
3. Compute
EC2
Virtual servers in the cloud
Amazon Machine Image
• Building blocks of EC2 instances
• An AMI is like a template of a computer's root volume.
• Can be public or private and shared with other accounts
• Create hardened or gold “Images” of your EC2 infrastructure
• Copy AMIs between regions
4. Compute
EC2
Virtual servers in the cloud
Auto Scaling
• Client Defined Business Rules
• Scale your Amazon EC2 capacity automatically once you define the conditions
(may be 1000’s of servers)
• Can scale up just a little…doesn’t need to be massive number of servers (may
be simply 2 servers)
• Well suited for applications that experience variability in usage
• Set minimum and maximum scaling policies
• Alternate Use is for Fault Tolerance
5. Compute
EC2
Virtual servers in the cloud
Elastic Load Balancing
• Supports the routing and load balancing of HTTP, HTTPS and generic TCP
traffic to EC2 instances
• Supports SSL termination and Proxy protocol
• Supports health checks to ensure detect and remove failing instances
• Dynamically grows and shrinks required resources based on traffic
• Seamlessly integrates with Auto-scaling to add and remove instances based
on scaling activities
• Single CNAME provides stable entry point for DNS configuration
• Supports internal load balancing within a VPC
6. Storage
S3
Scalable Storage in the Cloud
Simple Storage Service
• A “Bucket” is equivalent to a “folder”
• Able to store unlimited number of Objects in a Bucket
• Objects from 1B-5 TB; no bucket size limit
• Highly available storage for the Internet (object store)
• HTTP/S endpoint to store and retrieve any amount of data, at any time, from
anywhere on the web
• Highly scalable, reliable, fast, and inexpensive
• Annual durability of 99.999999999%
• Designed for 99.99% availability
• Over 2 trillion objects stored
• Peak requests 1,100,000+ per second
7. Storage
CloudFront
• Web service for content delivery
• Distribute content to end users with low latency, high data transfer speeds, and
no commitments
• Delivers your content using a global network of 40+ edge locations
• Supports download, streaming, live streaming, and dynamic content
– Key features: RTMP Streaming, HTTPS Delivery, Private Content for HTTP &
Streaming, Programmatic Invalidation, Detailed Logs for HTTP & Streaming, Default
Root Object
• Use Cases: Video and Rich Media, Online Gaming, Interactive Agencies,
Software Downloads, Static Websites
– Static web content that must be delivered to global user base at Highest bandwidth /
Lowest latency / Lowest cost
S3
Scalable Storage in the Cloud
CloudFront
Global Content Delivery Network
8. Database
Relational Database Service
• Fully-managed, tuned MySQL, PostgreSQL, Oracle 11g, or MS SQL
• Cost-efficient and resizable capacity
• Manages time-consuming database admin tasks
• Code, applications, and tools you already use today work seamlessly
• Automatically patches the database software and backs up your database
• Flexible Licensing: BYOL or License Include
• Multi-AZ deployment option for MySQL, PostgreSQL and Oracle
• Cross-Region Read Replica support for MySQL
RDS
Managed Relational Database Service
9. Database
ElastiCache
• Fully-managed, distributed, in-memory cache
• Memcached or Redis cache cluster on-demand
• Manages patching, cache node failure detection and recovery
• Simple APIs calls to grow and shrink the cache cluster
• Seamlessly caches in front of RDS instances
• Integrated with CloudWatch and SNS for monitoring and alerts
RDS
Managed Relational Database Service
ElastiCache
In-Memory Cache
11. HA CMS Architecture
WordPress servers
Availability Zone A Availability Zone B
WordPress servers
Auto Scaling Group
Elastic Load Balancer
RDS MySQL Primary RDS MySQL Standby
S3 Bucket
with Static
Media
12. Advanced HA CMS Architecture
Jenkins
(on EC2 instance)
WordPress servers
Availability Zone A Availability Zone B
WordPress servers
Auto Scaling Group
Elastic Load Balancer
RDS MySQL Primary RDS MySQL Standby
ElastiCache
Cache Node
ElastiCache
Cache Node
Amazon
Cloudfront
AWS CodeDeployGitHub
13. AVAILABLE
NOW
GitHub
Developer
S3 bucket
Jenkins
(on EC2 instance)
1. Push code to
remote repository
2. CodePipeline polls
GitHub for new commits
3. CodePipeline pulls
new commits into ZIP
file in S3
5. Jenkins runs
tests on code
and notifies
CodePipeline
of results
7. Servers
download
and install
AWS CodeDeploy
6. Servers are
notified of
deployment
4. Jenkins polls
CodePipeline for
new activity
Deployment overview
WordPress servers
(Auto Scaled)
8. CodeDeploy is
notified of success
or failure
AWS CodePipeline
14. CodeDeploy Lifecycle Events
AWS CodeDeploy
Elastic Load Balancer
Target Instance
S3 bucket
1. ApplicationStop
• Deregister from load
balancer
• Stop server
3. BeforeInstall
• Delete old version
• Install dependencies
• Install New Relic agents
2. DownloadBundle
4. Install
5. AfterInstall
• Update permissions
• Download config/creds
• Mark deployment in New
Relic
6. ApplicationStart
• Start server
• Register with load balancer
0. Instance is notified of new
deployment
7. ValidateService
CodeDeploy is notified of successful
deployment
16. CodeDeploy Custom Deployment Configs
HOST_COUNT FLEET_PERCENT = 80
No less than 80% of hosts should be
healthy during deploy
No less than 10 hosts should be
healthy during deploy, regardless of
the number of instances
= 10
17. Failed Deployments in CodeDeploy
Deploy
version 1.5
Deploy
to OK
?
Yes
Deploy Failed
Deploy
to OK
?
Yes
Deploy
to OK
?
Yes
No No No
Done
version 1.4
Recover from a failed or canceled
deployment by creating a new
deployment of the previous version