Architec(ng for the Cloud Larry Gilreath II, Enterprise Solu5on Architect
Why Cloud?
On Demand } Uniform Pay As You Go
Available
What is Cloud?
On Demand } Uniform Pay As You Go
Available
What is Cloud?
Compute
Storage
Security Scaling
Database
Networking Monitoring
Messaging
Workflow
DNS Load Balancing
Backup CDN On Demand } Uniform Pay As You Go
Available
What is Cloud?
From one compute instance…
… to thousands
…and back to one
Loose coupling sets you free
• Load balance clusters
Web Servers
App Servers Loosely coupled
with a load balancer
How do I leverage AWS?
Loose coupling sets you free • Use a queue to pass messages between components
Web Servers
App Servers
Video Processing
Servers
Queue
Decouple (ers with a queue
How do I leverage AWS?
How do I leverage AWS?
Ver5cal scaling (more CPU, memory, and so on) will eventually run out of room.
How do I leverage AWS?
Ver5cal scaling (more CPU, memory, and so on) will eventually run out of room.
How do I leverage AWS?
Add and remove instances as needed
How do I leverage AWS?
Add and remove instances as needed
How do I leverage AWS?
Base OS AMI
An AMI with minimal
components (OS, J2EE, and
Chef/Puppet) is launched. All
configuration occurs via
Chef/Puppet after instance
launch
OS AMI and library of recipes (install scripts)
Amazon EC2
Linux
JEE
Your Code
S3
Hibernate
Tomcat
Log4J
Spring
Struts
Apache
Linux
JEE
Linux
JEE
Chef/Puppet
Chef/puppet
scripts
OS AMI
Fetch on boot
How do I leverage AWS?
Auto Scaling Group
Result
Availability Zone A Availability Zone B
How do I leverage AWS?
Auto Scaling Group
Availability Zone A Availability Zone B
How do I leverage AWS?
Auto Scaling Group
Availability Zone A Availability Zone B
How do I leverage AWS?
Auto Scaling Group
Availability Zone A Availability Zone B
How do I leverage AWS?
Auto Scaling Group
Availability Zone A Availability Zone B
Foundation Services
Compute Storage Database Network
AWS Global Infrastructure Regions
Availability Zones Edge Locations
Client-side Data Encryption & Data Integrity Authentication
Server-side Encryption (File System and/or Data)
Network Traffic Protection (Encryption/Integrity/Identity)
Platform, Applications, Identity & Access Management
Operating System, Network & Firewall Configuration
Customer Data
AWS
Cus
tom
er
Scale without Compromising Security
Virtual Private Cloud (VPC)
A Scalable Web Architecture on AWS
Availability Zone 1
Web Server Web Server
App Server App Server
Auto Scaling Group (Web Tier)
Auto Scaling Group (App Tier)
SLB
Master
Availability Zone 2
Web Server Web Server
App Server App Server
Auto Scaling Group (Web Tier)
Auto Scaling Group (App Tier)
Slave
Availability Zone n
Backups
Static Content
www.mywebsite.com
Build security in every layer
SLB
Legend EC2 Instance +
CloudWatch
Security Group
Elas5c Load Balancer
Route 53 Hosted Zone
CloudFront
S3 Bucket
RDS Instance
SSL @ ELB Security Group:
TCP 80 “amazon-‐elb-‐sg”
Security Group: TCP 8080 “web”
Security Group: TCP 8080 “slb”
DB connec(on over
SSL
DB Security Group: TCP 3306 “app”
Encrypted file system over EBS
Bucket policy limi(ng access
Legend AmazonEC2
Instance + CloudWatch
Security Group
Elas5c Load Balancer
Route 53 Hosted Zone
CloudFront
Amazon S3 Bucket
Amazon RDS Instance
Amazon CloudFormation Deployment and Management
… and then reuse! Use AWS CloudFormation’s sample templates or create your own templates to describe the AWS resources, and any associated dependencies or runtime parameters, required to run your application.
Deploy and update a template and its associated collection of resources “called a stack” via the AWS Management Console, AWS CloudFormation command line tools or APIs. CloudFormation is available at no additional charge, and you pay only for the AWS resources needed.
Template AWS CloudForma5on Stack
What about scaling the Data Tier? This is where NuoDB delivers HUGE value …
Here are some addiBonal resources: AWS CloudFormation Sample Templates: https://aws.amazon.com/cloudformation/aws-cloudformation-templates/
AWS User Groups: http://aws.amazon.com/usergroups/
Introduction to AWS IAM Training Video: https://us-east-1-aws-training.s3.amazonaws.com/intro/iam.html
Service Documentation: http://aws.amazon.com/documentation
Pricing Calculator: http://aws.amazon.com/calculator/
Economics: http://aws.amazon.com/economics/
Pricing details for all services: http://aws.amazon.com/pricing/
Solutions Case Studies: http://aws.amazon.com/solutions/case-studies
Marketing Overview Materials: http://aws.amazon.com
Videos & Webinars: http://www.youtube.com/AmazonWebServices
AWS Blog: http://aws.typepad.com/
Architecting for the Cloud
Seth Proctor, CTO @technicallyseth
What’s unique about “cloud”?
Cloud architecture On-demand
Scale-out for capacity & availability Public infrastructure; dynamic provisioning
Flexible Commodity Hybrid (public & private)
Simple Monitoring & management Platform APIs and automation
Resilient
Why a different architecture?
Greater capacity Cost-effectiveness Higher availability and better failure-handling Lower latencies for global deployment
Challenges
Distribution brings challenges Lots of failures happen with frequency More difficult to get a global view Security & data lifecycle is harder Everything else about “distributed computing”
Still, we can scale most layers Load-balancers & name services at the top Horizontally-scaled app servers Caches & CDNs for content Redundant disks and object stores
Scaling the database is the real challenge
Traditional database design
RDBMS architectures start at the disk Vertical scale follows Caching helps, but often breaks consistency HA systems become very expensive
Schema & operation is hard to evolve Hard to harness commodity infrastructure Not designed to scale-out
Common options
Replication Active-passive or (gulp) multi-master Replicated data but visible delays & conflict
Sharding Split one database into many sub-sets More capacity but hard to evolve and relate
Abandon consistency Push correctness & conflict to the application Simpler core architecture but painful for
applications and hard to reconcile failures
Side-effects
Applications are tied to deployment Hence, dev-ops Complex for on-demand changes, failures
More, independent pieces Harder to interpret failures Complexity
Global deployment
Many motivations Disaster Recovery Lower-latency for distributed users Data access & storage residency rules
Trade-offs between latencies and safety Storage may be a separate concern from interaction
Approach Shared Disk Shared-Nothing/Sharded
Durable Distributed Cache
Key Idea Sharing a file system. Independent databases for disjoint subsets of data.
Replicating data in memory on-demand.
Topology
Example Oracle RAC DB2 Pure Scale
MySQL Cluster and most NoSQL/NewSQL
solutions
Distributed Database Designs
*Note: Most major web properties include custom-sharded MySQL or sharded PostgreSQL, including Facebook, GOOGLE, Wikipedia, Amazon, Flickr, Box.net, and Heroku. 12
Peer to Peer Architecture
P
P P
S3Disk , ...
P
P NuoDB Database Peer Process
Provisioned, Manageable Resources
Peer to Peer Communications
SQL Client
Management Client
SQL Front-EndSQL Optimizer
Transaction Handling
Object CachingObject Coordination
Durability
P
Magic Quadrant 2013
About NuoDB
Magic Quadrant 2013 & 2014
NuoDB delivers a distributed SQL database management system specifically designed for the cloud and the modern datacenter.
Magic Quadrant 2013
Summary
When architecting for the cloud.. Look for distributed architectures with on-
demand capabilities Layer & abstract to support evolution and
react gracefully to failures Assume your needs will evolve; plan with
scale in mind
Please try out NuoDB! http://dev.nuodb.com
Thank you!
Recommended