5. Cloud Architecture Lessons
using Amazon Web Services
1. Design for failure and nothing fails
2. Loose coupling sets you free
3. Implement “Elasticity”
4. Build Security in every layer
5. Don't fear constraints
6. Think Parallel
7. Leverage different storage options
6. 1. Design for Failure
…and nothing will really fail
"Everything fails, all the time"
Werner Vogels, CTO Amazon.com
Avoid single points of failure
Assume everything fails, and design backwards
Goal: Applications should continue to function even if the
underlying physical hardware fails or is removed or replaced.
7. 1. Design for Failure
AWS provides tools to make your life easier
Use Elastic IP addresses, Route53
Use multiple Amazon EC2 Availability Zones (AZs)
Create database slaves across AZs
Use monitoring and alerting
Use persistent storage
Automate operational processes
8. 2. Build Loosely Coupled Systems
The looser they're coupled, the bigger they scale
Independent components
Design everything as a Black Box
De-coupling for Hybrid models
Load-balance services
Amazon SQS and SWF
9. 3. Implement Elasticity
Elasticity is a fundamental property of the Cloud
Bootstrap your instances: “Who am I & what is my role?”
Use designs that are resilient to reboot and re-launch
Use Auto-scaling
Use Elastic Load Balancing
Use configurations in a durable store to bootstrap instance
10. 4. Build Security in every layer
Design with Security in mind
Create distinct Security Groups for each app tier/role
Restrict external access to IP ranges
Encrypt data “at-rest” and “in-transit”
Use Multi-Factor Authentication
Use Amazon Virtual Private Cloud
11. 5. Don't fear constraints
Re-think architectural constraints
More RAM? Distribute load across machines
Shared distributed in-memory cache
Better IOPS on my database?
Multiple read-only / sharding / DB
clustering / Non-relational
Your hardware failed or messed up config?
simply throw it away and switch to new
hardware with no additional cost
Performance
Caching at all levels (Data, Pages, Amazon CloudFront)
12. 6. Think Parallel
Horizontal scaling instead of vertical scaling…
Use Elastic Load Balancing to distribute load across multiple servers
Experiment with different architectures in parallel
Multi-threading and Concurrent requests to cloud services
Run parallel MapReduce Jobs
13. 7. Leverage many storage options
One size does not fit all
Amazon S3: large static objects
Amazon Cloudfront: content distribution
Amazon DynamoDB: simple querying, seemless scale
Amazon EC2 local disc drive : transient data
Amazon EBS: persistent storage + Snapshots on S3
Amazon RDS: RDBMS service (MySQL, Oracle, MS SQL Server)
14. Cloud Architecture Lessons
Best Practices
1. Design for failure and nothing fails
2. Loose coupling sets you free
3. Implement Elasticity
4. Build Security in every layer
5. Don't fear constraints
6. Think Parallel
7. Leverage many storage options
19. Autoscaling
3 Approaches to design MDE
Three Services: Better Together
Elastic Load
Balancer Latency
Utilization
Auto Scaling CloudWatch
Metrics
20.
21. US East Region (N. VA) EU West Region (Ireland) Japan Region (Tokyo)
Availability Availability Availability Availability
Zone A Zone B Zone A Zone B Availability Availability
Zone A Zone B
Availability Availability
Availability
Zone C Zone D
Zone C
US West 1 Region (N. CA) APAC Region (Singapore) US West 2 Region (Oregon)
Availability Availability Availability Availability Availability Availability
Zone A Zone B Zone A Zone B Zone A Zone B
28. Automation Enables
Provisioning of Environments
Recovery from Failure
Schedule Big Data Analysis
Scaling Out / In / Up /Down
Create Touchless systems
44. How Can I Obtain Info about Myself
from a Running Instance?
http://169.254.169.254/latest/meta-data
ami-id local-hostname
ami-launch-index local-ipv4
ami-manifest-path mac
block-device-mapping/ network/
hostname placement/
instance-action profile
instance-id public-hostname
Instance-type public-ipv4
kernel-id public-keys/
reservation-id