Building powerful web applications in the AWS Cloud : A Love Story, Design patterns in web-based cloud architecture, Jinesh Varia gave this talk at Cloud Connect and several other places
...
Building powerful web applications in the AWS Cloud : A Love Story, Design patterns in web-based cloud architecture, Jinesh Varia gave this talk at Cloud Connect and several other places
Amazon Web Services at Amazon Web ServicesIt now has Video: http://www.slideshare.net/AmazonWebServices/video-building-powerful-web-applications-in-the-aws-cloud-a-love-story-jinesh-varia2 years ago
Are you sure you want to
Danny ForestAwesome presentation by Jinesh Varia. Great fictional story and really good scaling tips. Gives a perfect idea of what Amazon AWS can offer!2 years ago
Amazon Web Services serves hundreds of thousands of customers in more than 190 countries from startups to Fortune 500s. Ourcusetomers include internet businesses like Netflix and Yelp; media companies like Newsweek and NY times and large enterprises like Shell, Farmer’s insurance and Hitachi.
Amazon Web Services serves hundreds of thousands of customers in more than 190 countries from startups to Fortune 500s. Ourcusetomers include internet businesses like Netflix and Yelp; media companies like Newsweek and NY times and large enterprises like Shell, Farmer’s insurance and Hitachi.
The AWS Cloud powers hundreds of thousands of businesses in 190 countries around the world. Large enterprises are using AWS for the following use cases:Running enterprise applications such as Oracle, SAP and Microsoft Applications (Windows Server, Sharepoint Server and SQL Server).Creating custom business applications to support the needs of internal functions such as HR, finance and sales.Developing customer-facing web applications that power ecommerce, mobile, gaming, social media and marketing websites.Processing Big Data and High Performance Computing workloads in the medical, imaging, genome sequencing, web analytics and business intelligence fields. Disaster Recovery, Backup or Archive of business critical data to the Amazon Web Services cloud.
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Using Elastic Ips for upgrade process
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
Single InstanceWeb Application Architecture in 1 AZ
2-Tier Auto-scalable Web Application Architecture with HA RDS database (Multi-AZ Setup)
2-Tier Auto-scalable Web Application Architecture with HA RDS database (Multi-AZ Setup)
2-Tier Auto-scalable Web Application Architecture with HA RDS database (Multi-AZ Setup) and Multiple Read Replicas to distribute read load
2-Tier Auto-scalable Web Application Architecture with HA RDS database (Multi-AZ Setup) and Multiple Read Replicas to distribute read load
2-Tier Auto-scalable Web Application Architecture with HA RDS database (Multi-AZ Setup) and Multiple Read Replicas to distribute read load
3-Tier Auto-scalable Web and Application Tier architecture with HA database (Multi-AZ Setup)
3-Tier Auto-scalable Web and Application Tier architecture with HA database (Multi-AZ Setup)
3-Tier Auto-scalable Web and Application Tier architecture with HA database (Multi-AZ Setup)
Batch Processing Architecture using Amazon Elastic MapReduce
For Non-hadoop Grid computing (scientific modeling) Use Spot and On-demand in Hybrid Fashion. Master Node in Cluster is on-demand instance, worker nodes are spot instances
3-Tier Auto-scalable Web and Application Tier architecture with HA database (Multi-AZ Setup)
3-Tier Auto-scalable Highly-Available Scalable Web and Application Tier architecture with HA database (Multi-AZ Setup) deployed in multiple AZs
2-Tier Auto-scalable Web Application architecture globally load balanced deployed in all regions(Software-based Data Replicator on top of Amazon RDS)
2-Tier Auto-scalable Web Application architecture globally load balanced deployed in all regions(MySQL Standard Master Slave Asynchronous Replication)Does not use Amazon RDS
2-Tier Auto-scalable Web Application architecture globally load balanced deployed in all regions(MySQL Standard Master-Master Asynchronous Replication)Does not use Amazon RDS
Introduction to Amazon Web Services - Build powerful web applications in the AWS Cloud : A Love Story - Jinesh VariaPresentation Transcript
Building Powerful Web Applications in the Cloud: A Love Story Jinesh Varia jvaria@amazon.com Follow me: @jinman linkedin in/jinman
The AWS Cloud Tools to access services Cross Service features High-level building blocks Low-level building blocks
Tools to access servicesCross Service featuresHigh-level building blocksLow-level building blocks
Powering the Most Popular Internet Businesses
Trusted by Enterprises and Government Agencies
Business Oracle, SAP, Microsoft, IBMApplications Line-of-Business Applications GamingWeb Digital Media DistributionApplications Media Sharing Customers running on AWS Analytics for Consumer WebBig Data & High Genome SequencingPerformance Computing Large Scale Batch Processing Backup & RecoveryDisaster Recovery Disaster Recovery& Archive Archive
Story
Story of Scalability
Thursdate.com
Thursdate.comMagical Elastic Dating Every Thursday an ephemeral website that leverages On-Demand Cloud Infrastructure Goes Live: Thursday 4:00 PM Shuts Down: Thursday 7:00 PM “Black Friday Effect” Repeats every Thursday of the Week
www.myjavawebsite.com Elastic IP Apache Tomcat Buckets Amazon S3 MySQL Backups Amazon EC2 InstanceAvailability Zone #1
Pattern #1: Design for failure and nothing will fail
www.myjavawebsite.com Elastic IP Apache Tomcat Buckets Amazon S3 MySQL Backups Amazon EC2 InstanceAvailability Zone #1
www.myjavawebsite.com Elastic IP Apache Tomcat Logs Static Data Buckets Amazon S3 MySQL Backups Amazon EC2 Instance Root Data Volume Volume Snapshots Amazon EBSAvailability Zone #1
Pattern #2: Edge cache static content
www.myjavawebsite.com Elastic IP Apache Tomcat Logs Static Data Buckets Amazon S3 MySQL Backups Amazon EC2 Instance Root Data Volume Volume Snapshots Amazon EBSAvailability Zone #1
media.myjavawebsite.com (static data) www.myjavawebsite.com (dynamic data) Elastic IP Amazon Distribution CloudFront Apache Tomcat Logs Static Data Buckets Amazon S3 MySQL Backups Amazon EC2 Instance Root Data Volume Volume Snapshots Amazon EBSAvailability Zone #1
media.myjavawebsite.com (static data) www.myjavawebsite.com (dynamic data) Elastic IP Amazon Distribution CloudFront Apache Tomcat Logs Static Data Buckets Amazon S3 MySQL Backups Amazon EC2 Instance Root Data Volume Volume Snapshots Amazon EBSAvailability Zone #1
media.myjavawebsite.com (static data) www.myjavawebsite.com (dynamic data) Elastic IP Amazon Distribution CloudFront Apache Logs Static Data Buckets Tomcat Amazon S3 Amazon EC2 Instance MySQL Backups Amazon RDSAvailability Zone #1
www.myjavawebsite.com staging.myjavawebsite.com Elastic IP Dynamic IP 183.2.3.1 172.3.1.4Tip: App v1.1 App v1.2Smart use of Apache ApacheElastic IPs Tomcat Tomcat(when upgradingnew versions of Production EC2 Instance Staging EC2 Production EC2 Instanceyour app) MySQL Amazon RDS Availability Zone #1
media.myjavawebsite.com (static data) www.myjavawebsite.com (dynamic data) Elastic IP Amazon Distribution CloudFront Apache Logs Static Data Buckets Tomcat Amazon S3 Amazon EC2 Instance MySQL Backups Amazon RDSAvailability Zone #1
Pattern #3: Implement Elasticity
media.myjavawebsite.com (static data) www.myjavawebsite.com (dynamic data) Elastic IP Amazon Distribution CloudFront Apache Logs Amazon Machine Buckets Static Data Image Tomcat Amazon S3 Amazon EC2 Instance MySQL Backups Amazon RDSAvailability Zone #1
www.myjavawebsite.com (dynamic data) media.myjavawebsite.com (static data) Amazon Route 53 (DNS) Elastic Load LB Balancer Amazon Distribution CloudFront Apache LogsAmazon Machine Buckets Static Data Image Tomcat Amazon S3 Amazon EC2 Instance Auto Scaling Group MySQL Backups Amazon RDS Availability Zone #1
www.myjavawebsite.com (dynamic data) media.myjavawebsite.com (static data) Amazon Route 53 (DNS) Elastic Load LB Balancer Amazon Distribution CloudFront Amazon SNS (notifications) Apache Logs Static Data Buckets Tomcat Amazon S3 Amazon EC2 Amazon DynamoDB Instance (all Key Value data) Auto Scaling Group Amazon CloudWatch (Monitoring) MySQL Backups Amazon RDSAmazon Simple Email Service (SendMail) Availability Zone #1
www.myjavawebsite.com media.myjavawebsite.com (dynamic data) (static data) Amazon Route 53 (DNS) Elastic Load LB Balancer Amazon Distribution CloudFront Amazon SNS Apache Apache (notifications) Logs Static Data Buckets Tomcat Tomcat Amazon S3 Auto Scaling group : Web App Tier Amazon DynamoDB (all Key Value data) Amazon EC2 MySQL Amazon RDS Backups Amazon CloudWatch (Monitoring) Availability Zone #1Amazon Simple Email Service (SendMail)
DB?
Pattern #4: Leverage Multiple Availability Zones
www.myjavawebsite.com (dynamic data) Amazon Route 53 (DNS) Elastic Load LB Balancer media.myjavawebsite.com (static data) Apache Apache Amazon Tomcat Tomcat Distribution CloudFront Auto Scaling group : Web App Tier Amazon EC2 Primary Buckets Amazon S3 Multi-AZ Amazon RDSAvailability Zone #1 Standby Slave Amazon RDS Availability Zone #2
Pattern #5: Isolate read and write traffic;Isolate static and dynamic traffic
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Amazon Distribution CloudFront Amazon EC2 Apache Apache Tomcat Tomcat Auto Scaling group : Web App Tier Async Replication Primary Read Read Buckets Amazon S3 Replica Replica Master Amazon RDSAvailability Zone #1 Standby Multi-AZ Amazon RDS Availability Zone #2
Magical Elastic Dating Every Thursday With no past memories“Whatever happens in those 3 hours, stays in ….” New Feature: Themes Doctors Nerds/Geeks Philosophers Mac fans
Pattern #6: Automate your in-cloud Software Development and Deployment Lifecycle
Automate Using Cloud APIsBuild andDeployment
Dev Test/QA Staging Prod
Dev Test/QA Staging Prod
Environmental separation Dev Test/QA Staging ProdChanges made here Shouldn’t affect here
Environmental consistencyDev Test/QA Staging Prod Same OS, Same services, Same versions, Same packages Same configs
Variable resources Dev Test/QA Staging ProdAll in one Multi-Tier Multi-Tier Multi-TierLocal data Test Data HA HA, Prod Data Monitoring Prod Data
Different control levels Dev Test/QA Staging ProdDevelopers Testers Testers and Testers and Administrators Administrators
Cloud-Powered Software Development Lifecycle Dev Test/QA Staging ProdRepeatability : pre-configured AMIs and SnapshotsProductivity : Build once, Deploy multiple timesSavings : Suspend and Resume (Pay as you go)Freedom to Experiment : New designs, architectures, services, models
Cloud-Powered Software Development LifecycleDev Test/QA Staging Prod Speed: quickly get on-demand resources Variety: test more demo configurations Real world load and stress testing : simulate 100s of clients Repeatability: Preconfigured shareable Test DB in minutes Reproducibility : “Save As” Prod Env and relaunch in Test Env Savings : “Turn off” Testing Environment
6 PM 7 AMPROD Bob Test Ted Test Mary Test Very Very VeryVery Large Small Small Small Server Server Server Server Storage Storage Storage Storage
Cloud-Powered Software Development LifecycleDev Test/QA Staging Prod Black-Red Pattern: Smooth termination Full Monitoring: CloudWatch Monitoring Alerts and Notifications: Alarms and SNS High Availability and Fault-tolerant : Multi-AZ Apps and DB Auto-Scaling: Quick Provisioning
Cloud-Powered Software Development LifecycleDev Test/QA Staging Prod AWS CloudFormation + Chef (or Puppet)
Cloud-Powered Software Development LifecycleDev Test/QA Staging Prod 2-tier app 2-tier app with 2-tier app with with small DB production data production data All in one instance Multi-AZ and HA AWS CloudFormation + Chef (or Puppet)
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Amazon Distribution CloudFront Amazon EC2 Apache Apache Tomcat Tomcat Auto Scaling group : Web App Tier Async Replication Primary Read Read Buckets Amazon S3 Replica Replica Master Amazon RDSAvailability Zone #1 Standby Multi-AZ Amazon RDS Availability Zone #2
Pattern #7: Cache as much as possible
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Amazon Distribution CloudFront Amazon EC2 Apache Apache Tomcat Tomcat Auto Scaling group : Web App Tier Async Replication Primary Read Read Buckets Amazon S3 Replica Replica Master Amazon RDSAvailability Zone #1 Standby Multi-AZ Amazon RDS Availability Zone #2
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Distribution Amazon Apache CloudFront Apache Tomcat Tomcat Auto Scaling group : Web Tier Amazon EC2 ElastiCache Memcache Memcache Tomcat cache Tier RDS Buckets Amazon S3 MasterAvailability Zone #1 RDS MultiAZ Availability Zone #2
Pattern #8: Hardening security at every stage
In the cloud, Security is a Shared Responsibility Encrypt data in transitSAS 70 Type II Audit Encrypt data at restISO 27001/2 Certification Protect your AWS CredentialsPCI DSS 2.0 Level 1-5 Rotate your keysHIPAA/SOX Compliance Secure yourFISMA A&A Moderate Infrastructure Application application, OS, Stack and Security Security AMIsHow we secure our How can you secure yourinfrastructure application and what is your responsibility? Services Security Enforce IAM policiesWhat security options Use MFA, VPC, Leverage S3and features are available bucket policies, EC2 Securityto you? groups, EFS in EC2 Etc..
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB #Permit HTTP(S) access to Web Layer Balancer from the Entire Internet ec2auth Web -p 80,443 -s 0.0.0.0/0 Distribution Amazon Apache CloudFront Apache Tomcat Tomcat Auto Scaling group : Web Tier Amazon EC2#Permit Web Layer access to App Layer ec2auth App -p 8000 –o Web ElasticCache Memcache Memcache Tomcat # Permit App Layer access to DB ec2auth DB -p 3209 –o App Cache Tier # Permit admin access SSH to all three Amazon S3 RDS Buckets layers Master # First allow connection from office to Web tier, and from there to the other layers Availability Zone #1 ec2auth Web -p 22 -s <forexample, network block of your office> RDS ec2auth App -p 22 -o Web Slave Availability Zone #2 ec2auth DB -p 22 -o Web
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Distribution Amazon Apache CloudFront Apache Tomcat Tomcat Auto Scaling group : Web Tier Amazon EC2 Memcache Memcache Tomcat cache Tier RDS Buckets Amazon S3 MasterAvailability Zone #1 RDS MultiAZ Availability Zone #2
Amazon S3 Upload large datasets or log Amazon S3 Data files directly Input Source Data Output Data Task Amazon Elastic Node MapReduce Amazon SimpleDB Mapper Code/ Reducer Name Task Metadata Service Scripts HiveQL Node Node Pig Latin Cascading Runs multiple JobFlow Steps Core HiveQL Node Pig Latin QueryCloud Tip: Core Node HDFSThink in parallel BI Apps Amazon Elastic MapReduce JDBC/ODBCand process your Hadoop Clusterlogs usingAmazon ElasticMapReduce
Spot Instances
Run Task Nodes on Spot Amazon S3 Upload large datasets or log Amazon S3 Data files directly InputSource Data Output Data Task Amazon Elastic Node MapReduce Amazon SimpleDB MapperCode/ Reducer Name Task Metadata ServiceScripts HiveQL Node Node Pig Latin Cascading Runs multiple JobFlow Steps Core HiveQL Node Pig Latin Query Core Node HDFS BI Apps Amazon Elastic MapReduce JDBC/ODBC Hadoop Cluster
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load LB Balancer Distribution Amazon Apache CloudFront Apache Tomcat Tomcat Auto Scaling group : Web Tier Amazon EC2 Memcache Memcache Tomcat cache Tier RDS Buckets Amazon S3 MasterAvailability Zone #1 RDS MultiAZ Availability Zone #2
www.myjavawebsite.com (dynamic data) Amazon Route 53 media.myjavawebsite.com (DNS) (static data) Elastic Load Balancer LB Auto Scaling group : Web Tier Auto Scaling group : Web Tier Apache Apache Apache Apache Tomcat Tomcat Tomcat Tomcat Distribution Amazon EC2 Amazon CloudFront Memcache Memcache Memcache Memcache Tomcat Tomcat Cache Tier Cache TierAmazon ElastiCache DB Multi-AZ Buckets Amazon RDS Slave Master Read ReplicaAvailability Zone #1 Availability Zone #2 Amazon S3 Availability Zone #n
Pattern: #9: Go Global Quickly (with single API)
Centralized Architecture Web Application is hosted in a centralized location in US-East region Web Application is accessed Europe from US-West , US-East US-East , Europe and Asia Pacific regionsUS-West Asia Pacific
Geo Distributed Architecture Data is synchronized between Data Replicator databases across regions using the Custom data replicator programWeb Application is hosted in Web Applicationglobally (US-West, US- requests are directedEast, Europe and Asia Pacific) to the servers residing in nearest regions Europe US-East US-West Asia Pacific
US West Traffic US East Traffic Europe Traffic Asia Traffic Geo IP/Directional DNS Server ELB ELB ELB ELB Web Web Web Web Web Web Web Web Web Web Web Web Web Web Web Web App Web App Web App Web App Web App Web App Web App Web App Web App App App App App App App App App App App App App App App App Auto Scaling group : Web Auto Scaling group : Web Auto Scaling group : Web Auto Scaling group : Web App Tier App Tier App Tier App Tier RDS RDS RDS RDS Master Master Master MasterUS-West US-East EU-West AP-SOUTHEAST RDS RDS RDS RDS Multi-AZ Multi-AZ Multi-AZ Multi-AZ US-West-1b US-East-1b EU-West-1b AP-SOUTHEAST-1b Software-based Data Replicator
US West Traffic US East Traffic Europe Traffic Asia Traffi Geo IP/Directional DNS Server ELB ELB ELB ELB Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group RDS RDS RDS RDS RDS RDS RDS Master Slave Master Slave Master Slave MasteUS-West US-East-1a EU-West Singapore US-East-1b Software-based Data Replicator
US West Traffic US East Traffic Europe Traffic Asia Traffi Geo IP/Directional DNS Server ELB ELB ELB ELB Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group Reads R Reads MySQL MySQL Reads MySQ MySQL Slave Master Slave SlaveUS-West MySQL EU-West Singapore Slave US-East-1a US-East-1b MySQL Standard Master-Slave Asynchronous Replication
US West Traffic US East Traffic Europe Traffic Asia Traffi Geo IP/Directional DNS Server ELB ELB ELB ELB Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Apache Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Tomcat Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group : Web App Tier Auto Scaling group MySQL MySQL MySQL MySQL MySQL MySQL MySQL Master Slave Master Slave Master Slave MasteUS-West US-East-1a EU-West Singapore US-East-1b MySQL Standard Master-Master Replication
$$
Pattern #10: Keep optimizing and see the savings in the next month’s bill
450,000 On Demand 1-year RI 3-year RI400,000350,000300,000250,000200,000 2150,000100,000 3 50,000 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1-year RI versus On Demand: 1 cost savings realized after first 6 months of usage 3-year RI versus On Demand: 2 cost savings realized after first 9 months of usage. 3-year RI versus 1-year RI: 3 Net savings of 3-year RI versus 1-year RI begin by month 13 and continue throughout the RI term (additional 23 months of savings)
Pattern #1: Design for failure and nothing will failPattern #2: Edge cache static contentPattern #3: Implement ElasticityPattern #4: Leverage Multiple Availability ZonesPattern #5: Isolate read and write traffic; Isolate static and dynamic trafficPattern #6: Automate your in-cloud Development and Deployment LifecyclePattern #7: Cache as much as possiblePattern #8: Hardening security at every stagePattern #9: Go global quickly (with single API)Pattern #10: Keep optimizing and see the savings in the next month’s bill
Thank you! Jinesh Varia jvaria@amazon.com Twitter:@jinmanThis slide deck is available athttp://slideshare.net/amazonwebservices
http://aws.amazon.com/whitepapers
http://aws.amazon.com
AWS Elastic Beanstalk“Put your application on Auto Pilot”
Create Upload Launch ManageApplication Version Environment Environment Myapp.elasticbeanstalk.com Elastic Load Balancer L B •Deploy Versions •Edit Configuration Web Server •Monitor Health Amazon S3 App Server Logs Buckets •View Logs Amazon EC2 Micro Instance •Restart App Server Auto Scaling Group •Rebuild Infrastructure •Terminate 8GB Root 2GB Data Volume Volume Snapshots Availability Zone #1
Elastic Beanstalk “under the hood” Versions Application Versions Environments Versions myapp-integration.elasticbeanstalk.com Amazon S3 myapp_v3.war ELB optional: log files Amazon EC2 Instance(s)Auto-Scaling Group Apache (Web Server) Elastic Beanstalk Host Manager Tomcat (App Server) myapp_v3.war Amazon Linux AMI 8GB Root 2GB Data Volume Volume
AWS CloudFormation“Provision your infrastructure stack using one script”
AWS CloudFormation: Provisioning cloud resources made easy• Fully declarative system• Document based infrastructure specification• Logical naming convention• Atomically creates / destroys groups of AWS objects together• Deploy multi-tier and multi-AZ stacks• Handles the bookkeeping and muck of provisioning multiple related resources• Focuses on AWS resources, while sys admins and developers focus on OS and application provisioning
AWS CloudFormation: Provisioning cloud resources made easy Check theSignup and Create a See Stack Delete the Stack Setup Stack Events Stack Status JSON Template
Let LinkedIn power your SlideShare experience
+
Let LinkedIn power your SlideShare experience
Customize SlideShare content based on your interests
We will import your LinkedIn profile and you will be visible on SlideShare.
Keep up to date when your LinkedIn contacts post on SlideShare
thanks ! 1 year ago