Architecting Cloud Apps


Published on

AWS Start-up event 2009 - Architecting Cloud Apps

  • good
    Are you sure you want to  Yes  No
    Your message goes here
  • Can I have access to download this presentation ?
    this presentation is excellent.
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Explain each service features and details here
  • This is your classic three tier architecture. Incoming requests are fielded by a web server. The web server probably also draws files (such as images, PDFs, music, and so forth) from a file server. The web server farms processing out to a number of servers running an application server. This is where the bulk of your application’s business logic probably resides. You probably maintain a relational database on the back-end as well.
  • Let’s start our migration project by moving many of our static and large files over to Amazon S3. Things like images, music, PDFs, and the like are best suited for Amazon S3. Amazon S3 provides a low-cost, highly reliable and scalable storage environment for your web applications.
  • Many times you’ll have a number of users hitting your web application from all over the world. It can be time consuming and slow to serve all of those users’ requests from Amazon S3. That’s why we built Amazon CloudFront. Amazon CloudFront is a content delivery network that takes the data you’ve stored in Amazon S3 and caches it across a worldwide network of edge locations. In this way, the large static files used by your web application are stored as close as possible to the users who are requesting them.
  • Amazon EC2 enables you to choose the operating system and application platform of your choice to host your web application. Whether it’s Microsoft .NET, IBM WebSphere, JBoss, Oracle Fusion Middleware, PHP, Ruby on Rails, or whatever, you can configure your own virtual environment to run the platform you need for your business. This is where you’ll move your web application, altering it to point to the persistent files you’ve moved to Amazon S3.
  • A typical web application has a front-end web server to field incoming requests, which then farms out work to a bunch of application servers. You can move these applications ervers to Amazon EC2 as well.
  • You’ll also want to move your database into the cloud. Amazon Elastic Block Store is a feature of Amazon EC2 that provides a block storage device in the cloud. You’d house your database in Amazon EBS. Amazon EBS can also be setup to periodically snapshot backup images into Amazon S3, so you can always roll back to a version of Amazon EBS if you need to, and you can rest assured that your database will exhibit the same resilient and reliable characteristics as the rest of AWS.
  • Amazon SQS is a queueing service that provides the glue between your web server and your application server. The most common setup will involve configuring two queues. The first queue will accept messages from the web server hosted on Amazon EC2. Application servers, also hosted on Amazon EC2, will pluck those messages off the queue, process data based on the contents of the message, and then place the equivalent of an “I’m done! Here are the results.” message on the second queue. The web server would then pluck the message off the second queue and return results back to the client that made the initial request. In this way, your Amazon EC2 instances can grow or shrink, startup and fail with impunity, while you can rest assured that all of your data processing happens reliably.
  • Amazon SimpleDB can be added to the equation to store your access logs, application logfiles, and even indices to data you’re storing in Amazon S3.
  • Amazon SimpleDB can be added to the equation to store your access logs, application logfiles, and even indices to data you’re storing in Amazon S3.
  • Architecting Cloud Apps

    1. 1. Jinesh Varia Technology Evangelist<br />Architecting<br />for the AWS Cloud<br />Twitter: @jinman<br />
    2. 2. Cloud Computing Attributes<br />What makes the Cloud so attractive<br />Abstract Resources<br />Focus on your needs, not on hardware specs. As your needs change, so should your resources.<br />On-Demand Provisioning<br />Ask for what you need, exactly when you need it. Get rid of it when you don’t need<br />Scalability<br />Scale out or in depending on usage needs.<br />No Up-Front Costs<br />No contracts or long-term commitments.<br />Pay only for what you use.<br />Efficiency of Experts<br />Utilize the skills, knowledge and resources of experts.<br />
    3. 3. The Cloud<br />The “Living and Evolving” Cloud<br />AWS services and features<br />Most Applications Need:<br />Compute<br />Storage<br />Messaging<br />Payment<br />Distribution<br />Scale<br />Analytics<br />Your Application<br />Amazon CloudFront<br />Amazon SQS Queues<br />Amazon<br />SimpleDB Domains<br />Payment : Amazon FPS/ DevPay<br />Amazon <br />Elastic MapReduceJobFlows<br />Amazon S3 Objects and Buckets<br />Auto-Scaling<br />LB<br />Cloud<br />Watch<br />Amazon EC2 Instances(On-Demand, Reserved)<br />EBS<br />Volumes<br />Snapshots<br />Amazon <br />Virtual Private Cloud<br />Amazon WorldWidePhysical Infrastructure <br />(Geographical Regions, Availability Zones, Edge Locations)) <br />
    4. 4. Amazon S3<br />Customer<br />runInstance()<br /> Amazon EC2<br />Amazon Elastic Compute Cloud<br />Resizable compute capacity in the cloud<br />Obtain and boot new server instances in minutes<br />Quickly scale capacity, up or down, using Web Services Interface<br />Hosted Virtualization<br />Full root-level access to the virtualized server instance<br />
    5. 5. Amazon EC2<br />WebSphere<br />Hibernate<br />Java<br />Linux<br />Amazon<br />Machine<br />Image<br />Ruby<br />Rails<br />MySQL<br />Fedora-6<br />Amazon<br />Machine<br />Image<br />PHP<br />Apache<br />Perl<br />Postgress<br />Linux-Ubuntu<br />Amazon<br />Machine<br />Image<br />Available in US and EU<br />New Terms and Features<br />Amazon Machine Images<br />Instances<br />Security Groups<br />Elastic IP Addresses<br />Availability Zones<br />Instance Types (M1, C1)<br />Elastic Block Store and Snapshots<br />Public DataSets<br />Platforms<br />Windows, Open Solaris, Linux (Fedora, Debian, Ubuntu, Centos …..)<br />AMIs : 1500+<br />Amazon S3<br />AMI<br />AMI<br />AMI<br />Amazon EC2<br />5<br />
    6. 6. EC2 API Overview<br />CreateVolume –<br />Create an EBS volume of any size (1 GB to 1 TB).<br />Images:<br />RegisterImage<br />DescribeImages<br />DeregisterImage<br />ModifyImageAttribute<br />DescribeImageAttribute<br />ResetImageAttribute<br />Instances:<br />RunInstances<br />DescribeInstances<br />TerminateInstances<br />GetConsoleOutput<br />RebootInstances<br />IP Addresses:<br />AllocateAddress<br />ReleaseAddress<br />AssociateAddress<br />DisassociateAddress<br />DescribeAddresses<br />Keypairs:<br />CreateKeyPair<br />DescribeKeyPairs<br />DeleteKeyPair<br />Security Groups:<br />CreateSecurityGroup<br />DescribeSecurityGroups<br />DeleteSecurityGroup<br />AuthorizeSecurityGroupIngress<br />RevokeSecurityGroupIngress<br />Block Storage Volumes:<br />CreateVolume<br />DeleteVolume<br />DescribeVolumes<br />AttachVolume<br />DetachVolume<br />CreateSnapshot<br />DescribeSnapshots<br />DeleteSnapshot<br />AttachVolume –<br />Attach an EBS volume to a running EC2 instance.<br />AssociateAddress –<br />Associate public IP address with a running EC2 instance.<br />DescribeImages –<br />Fetch a list of all available Amazon Machine Images (AMIs).<br />RunInstances –<br />Launch any number of AMIs on available hardware.<br />
    7. 7. ElasticFox<br />Enter AWS Credentials.<br />Select active set of AWS Credentials.<br />Enter desired number of running instances.<br />Additional importantfunctions on tabs.<br />Choose keypair.<br />Filter AMI List.<br />See list of available AMIs.<br />Go!<br />See list of running instances.<br />
    8. 8. Scalability<br />Build Scalable Architecture on AWS<br />A scalable architecture is critical to take advantage of a scalable infrastructure<br />Characteristics of Truly Scalable Service<br />Increasing resources results in a proportional increase in performance<br />A scalable service is capable of handling heterogeneity<br />A scalable service is operationally efficient<br />A scalable service is resilient<br />A scalable service becomes more cost effective when it grows<br />
    9. 9. Cloud Architecture Lessons<br />using Amazon Web Services<br />1. Design for failure and nothing fails<br />2. Loose coupling sets you free<br />3. Implement “Elasticity”<br />4. Build Security in every layer<br />5. Don&apos;t fear constraints<br />6. Leverage AWS storage options<br />
    10. 10. 1. Design for Failure<br />and nothing will really fail<br />&quot;Everything fails, all the time&quot;<br />Werner Vogels, CTO<br />Avoid single points of failure<br />Assume everything fails, and design backwards<br />
    11. 11. Design for Failure with AWS<br />Tools to make your life easier<br />Use Elastic IP addresses for consistent and re-mappable routes<br />Use multiple Amazon EC2 Availability Zones (AZs)<br />Create multiple database slaves across AZs<br />Use real-time monitoring (Amazon CloudWatch)<br />Use Amazon Elastic Block Store (EBS) for persistent file systems<br />
    12. 12.<br />EC2 Instance A<br />EC2 Instance B<br />MASTER<br />SLAVE<br />MASTER<br />Replication<br />LOG <br />Volume<br />DATA <br />Volume<br />DATA <br />Volume<br />
    13. 13.<br />Availability Zone 2<br />EC2 Instance B<br />EC2 Instance A<br />Availability Zone 1<br />MASTER<br />SLAVE<br />MASTER<br />Replication<br />DATA <br />Volume<br />DATA <br />Volume<br />LOG <br />Volume<br />LOG <br />Volume<br />Amazon S3<br />
    14. 14. 2. Build Loosely Coupled Systems<br />The looser they&apos;re coupled, the bigger they scale<br />Independent components<br />Design everything as a Black Box<br />De-couplingfor Hybrid models<br />Load-balance clusters<br />Use Amazon SQS as Buffers<br />Tight Coupling<br />Controller A<br />Controller B<br />Controller C<br />Q<br />Q<br />Q<br />Loose Coupling using Queues<br />Controller A<br />Controller B<br />Controller C<br />
    15. 15. 3. Implement Elasticity<br />Elasticity is fundamental property of the Cloud<br />Don’t assume healthor fixed location of components<br />Use designs that are resilient to reboot and re-launch<br />Bootstrapyour instances<br />Enable dynamic configuration<br />Use Auto-scaling (Free)<br />Use Elastic Load Balancing on multiple layers<br />Use configurations in SimpleDB to bootstrap instance<br />
    16. 16. 4. Build Security in every layer<br />Security is everywhere<br />Physical is free<br />Network is easy<br />The rest can be added<br />Create distinct Security Groups for each Amazon EC2 cluster<br />Use group-based rules for controlling access between layers<br />Restrict external access to specific IP ranges<br />Encrypt data “at-rest” in Amazon S3<br />Encrypt data “in-transit” (SSL)<br />Consider encrypted file systems in EC2 for sensitive data<br />Rotate your AWS Credentials, Pass in as arguments encrypted <br />Use MultiFactor Authentication<br />
    17. 17.
    18. 18. 5. Don&apos;t fear constraints<br />Re-think architectural constraints<br />More RAM? Distribute load across machines<br />Shared distributed cache<br />Better IOPS on my database? <br />Multiple read-only / sharding / DB clustering<br />Your server has better config? <br />Implement elasticity<br />Static IP?<br />Boot script for software reconfiguration from SimpleDB<br />
    19. 19. 6. Leverage many storage options<br />Which storage option to use when?<br />Amazon S3: large static objects<br />Amazon Cloudfront: content distribution<br />Amazon SimpleDB: simple data indexing/querying<br />Amazon EC2 local disc drive : transient data<br />Amazon EBS: RDBMS persistent storage + Snapshots on S3<br />
    20. 20. Cloud Architecture Lessons<br />Best Practices<br />1. Design for failure and nothing fails<br />2. Loose coupling sets you free<br />3. Design for dynamism<br />4. Build Security in every layer<br />5. Don&apos;t fear constraints<br />6. Leverage many storage options<br />
    21. 21. AWS community and Ecosystem<br />Find help, guidance, assistance when you need it<br />AWS Ecosystem<br />AWS Community<br />
    22. 22. Migrating<br />a Web Application<br />to AWS<br />Photo: La Pedrera - Casa Milà, Barcelona - Antonio Gaudi<br />
    23. 23. Migrating your Web Application<br />Step by Step towards AWS<br />A typical Web App needs:<br />Compute Power<br />Storage capacity<br />Content Distribution<br />Database storage<br />Messaging<br />Load balancing<br />Monitoring<br />
    24. 24. Migrating your Web Application - 1/8<br />Typical Web App Architecture<br />Database<br />Application Server /Business Logic<br />Web Server /<br />Presentation Layer<br />Client Browser<br />
    25. 25. Migrating your Web Application - 2/8<br />Amazon S3 for Storage<br />Store persistent files in Amazon S3 for lower costs, higher reliability<br />Client Browser<br />
    26. 26. Migrating your Web Application - 3/8<br />Use Amazon CloudFront<br />Amazon CloudFront for distribution<br />Amazon CloudFrontis a content delivery network that caches data stored in Amazon S3 across a network of 14 edge locations around the world<br />Client Browser<br />
    27. 27. Migrating your Web Application - 4/8<br />Amazon EC2 for your choice of web servers<br />Configure Amazon EC2 running your choice of web server to handle all incoming web requests.<br />Client Browser<br />
    28. 28. Migrating your Web Application - 4/8<br />Scale out App servers on Amazon EC2<br />Configure multiple Amazon EC2 instances running your choice of application server to process requests.<br />Use Availability Zones and Elastic IPs for greater reliability and resiliency.<br />Utilize Auto-scaling and Elastic LB service<br />Client Browser<br />
    29. 29. Migrating your Web Application - 5/8<br />Use Amazon EBS for Database<br />EBS for Persistent Storage and S3 for Snapshots<br />Configure an Amazon EBS device to host your existing relational database. Snapshots can be automatically backed up to Amazon S3.<br />Client Browser<br />
    30. 30. Migrating your Web Application - 6/8<br />Use Amazon SQS<br />Amazon SQS for queuing requests<br />SQS<br />Amazon SQS makes it easy to coordinate between the web server and application servers.<br />Client Browser<br />
    31. 31. Migrating your Web Application - 7/8<br />Use Amazon SimpleDB<br />Amazon SimpleDB for log files, metadata<br />SimpleDB<br />SQS<br />Amazon SimpleDBcan be used to store metadata, logfiles, and other information for your site.<br />Client Browser<br />
    32. 32. Migrating your Web Application - 8/8<br />Use Amazon SimpleDB<br />Monitor your Amazon EC2 instances using CloudWatch<br />SimpleDB<br />SQS<br />Amazon CloudWatch to monitoring your Amazon EC2 instances<br />Client Browser<br />
    33. 33. Migrating your Web Application<br />Step by Step towards AWS<br />A typical Web App needs:<br />With AWS:<br />Compute Power<br />Storage capacity<br />Content Distribution<br />Database storage<br />Messaging<br />Load balancing<br />Monitoring<br />Amazon EC2<br />Amazon S3<br />Amazon CloudFront<br />Amazon EBS<br />Amazon SQS<br />Amazon EC2<br />Amazon CloudWatch<br />
    34. 34. Other Services<br />Wait, there’s more…<br />Amazon Flexible Payments ServicePCI-compliant Payment infrastructure built from <br />the ground up for Developers<br />Amazon Mechanical Turk<br />A Flexible, Scalable Workforce with a programmatic interface <br />(400K People in 100 Countries)<br />Amazon Elastic MapReduce<br />Hosted Hadoop Framework on Amazon EC2 and Amazon S3 to crunch large amounts of data <br />AWS Import/Export<br />For uploading large datasets to Amazon S3, Ship us your hard drives - “sneaker net” to Amazon S3<br />
    35. 35. Amazon Web Services tools<br />Things you need<br />Web : AWS Management Console<br />IDE : AWS Toolkit for Eclipse<br />Tools : <br />iPhoneApps<br />CloudBerryExplorer<br />AWSZone<br />Firefox Plugins : <br />ElasticFox, S3Fox, SDB Tool<br />Several libraries<br />
    36. 36. Conclusions<br />Most Important Lesson From Our Customers:<br />Start small with a well-defined proof of concept that will <br />highlight the power of AWS<br />Build support in your organization<br />Once one application is launched others will follow…<br />Photo: Grand Canyon Hopi Point SunSet<br />
    37. 37. Thank you!<br /> Twitter:@jinmanPresentation idea from @simon<br />
    38. 38.<br />