Fowa Miami 09 Cloud Computing Workshop

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    15 Favorites

    Fowa Miami 09 Cloud Computing Workshop - Presentation Transcript

    1. How to build your app quickly (and cheaply?) using the Cloud
    2. Intro (Admin, facilities, who I am)
    3. Agenda
      • Overview
      • Walk-through deployment on PaaS and IaaS
      • Break
      • Considerations
        • Costs / Economics
        • Architecture
      • Discussion
    4. Goals for the workshop
    5. Cloud computing. WTF?
    6. WAN (Frame Relay, ISDN, etc.) Router Router LAN A LAN B
    7. For this workshop, it means: elastic compute resources, charged for like a utility
    8. Why bother?
    9. What’s a “web app”?
    10. http://www.flickr.com/photos/psd/6732568/in/set-666533/
    11. http://www.flickr.com/photos/psd/6733371/in/set-666533/
    12. http://www.flickr.com/photos/psd/6733187/in/set-666533/
    13. http://www.flickr.com/photos/gopal1035/322084210/
    14. http://www.flickr.com/photos/psd/58054545/
    15.  
    16.  
    17. It’s more than static content.
    18. So that means, it’s about any and all commercial web sites, right?
    19. No. Don’t think so.
    20. Griefer alert: is this just flamebait?
    21. No. In the context of cloud computing, it makes a difference.
    22. A big difference.
    23. Apps do something.
    24. Content doesn’t.
    25. Cloud computing is about doing something.
    26. http://www.nytimes.com/2006/06/14/technology/14search.html
    27. “ Microsoft is adding 10k servers a month to their infrastructure” http://blogs.zdnet.com/microsoft/?p=1391
    28. “ That’s one Facebook per month” http://www.datacenterknowledge.com/archives/2008/04/23/facebook-now-running-10000-web-servers/ http://www.istartedsomething.com/20080812/microsoft-enviroment-video-reveals-server-numbers-power/
    29. Amazon talks a lot about the demand…
    30. Animoto went from 50 to 3400 Amazon virtual servers in two days
    31. http://aws.typepad.com/aws/2008/04/animoto---scali.html
    32. The New York Times converted 4TB of TIFFs to PDFs in a day. For $240
    33. http://open.blogs.nytimes.com/2007/11/01/self-service-prorated-super-computing-fun/ http://open.blogs.nytimes.com/2008/05/21/the-new-york-times-archives-amazon-web-services-timesmachine/ http://www.roughtype.com/archives/2008/11/the_new_economi.php
    34. And Amazon shows everyone who will sit still for more than 5 seconds the following picture:
    35. http://aws.typepad.com/aws/2008/05/lots-of-bits.html
    36. Assumption: Mom+Pop ISP ™ cannot compete with this.
    37. Are Mom+Pop doomed?
    38. Ultimately, that depends on you, the developers of web apps.
    39. It’s going to depend on decisions you make about architectural and engineering concerns.
    40. Architecture is about making design choices. Engineering is about knowing your materials.
    41. Making use of the Cloud is an architectural and engineering challenge.
    42. So what are the architectural choices? What are the materials?
    43. http://rationalsecurity.typepad.com/blog/2009/01/cloud-computing-taxonomy-ontology-please-review.html http://cloudcomputing.sys-con.com/node/811519 http://www.collab-ogce.org/gce08/images/7/76/LamiaYouseff.pdf SADIST-PIMP SPI (SaaS, Paas, IaaS)
    44. http://www.mindmeister.com/maps/show_public/15936058
    45. But wait! Once that’s sorted, you have to consider contextual dimensions…
    46. The Radeztsky Cube http://cloudforum.googlegroups.com/web/Metaverse+Decomposition.pdf
    47. http://cloudforum.googlegroups.com/web/Metaverse+Decomposition.pdf
    48. IOW, your choices are influenced by whether you are integrating established apps, or writing a green-field app….
    49. And whether your architecture will be entirely in the public Cloud, or a mix of public and private resources.
    50. For the sake of this workshop, we’re going to refer to the SPI model…
    51. SPI Model SaaS PaaS IaaS
    52. We’re going to assume a green-field app, deployed entirely on the public Cloud…
    53. We’re going to focus on the scenario of “your code, running elsewhere” – not so much on mashups and re-use of SaaS
    54. And we’re going to examine the question of PaaS vs. IaaS for that app.
    55. Goals for the workshop
    56. OK. So what is PaaS?
    57. Platform As A Service
    58. Some examples: Google App Engine, Bungee, Force.com, Heroku
    59. Characterized by…
    60. Constraints on language and design
    61. A high level programming model
    62. A specific model of multi-tenancy
    63. Takes care of low level concerns
    64. Google App Engine
    65.  
    66.  
    67.  
    68.  
    69.  
    70. That’s it.
    71. Constraints on language and design (Python + BigTable + Goog Svcs)
    72. A high level programming model (The WebApp (or other Python) framework, Datastore APIs, Memcache, etc.)
    73. A specific model of multi-tenancy (Google’s BigTable + GFS platform)
    74. Takes care of the low level concerns (Scales for you (up and down), distribution across cluster nodes, load balancing, replication of data, etc. )
    75. Pretty cool.
    76. Infrastructure As A Service
    77. Characterized by…
    78. No constraints on language or design
    79. A high level architectural model
    80. A specific model of multi-tenancy
    81. Takes care of very few low level concerns
    82. This is a LOT more work. ;)
    83. Amazon Web Services
    84. Amazon Web Services
      • Elastic Compute Cloud (EC2)
      • SimpleDB
      • Simple Storage Service (S3)
      • Simple Queue Service (SQS)
      • EC2 Elastic Block Store (EBS)
      • Other stuff…
        • Cloudfront
        • DevPay
        • Flexible Payments Service (FPS)
        • Mechanical Turk
        • Alexa
    85. By and large, “Amazon” means “EC2”
    86. EC2 is the only AWS service that one deploys to
    87. You just use the other services – whether from an EC2 instance or anywhere else on the Web is irrelevant
    88. The core “unit” of EC2 is the Amazon Machine Image – AMI
    89. An AMI is a virtual machine image – a VM
    90. A VM is just a (very large) file. Like a live ISO disk image. Typically, it is some distro of Linux.
    91. Amazon uses Xen, an open source VM system http://www.xen.org/
    92. The key to IaaS is that you can use any app architecture you like
    93. The drawback with IaaS is that you therefore have to design your own app architecture
    94. Generally speaking, this is the same task (with the same effort) that you would need for physical hardware hosted at an ISP
    95. App servers, load balancers, databases, clusters, replication, networking…
    96. You sort it out yourself
    97. With Amazon, this begins with obtaining your credentials
    98.  
    99. Then you download the command line tools and set them up…
    100.  
    101. You use the tools to proceed through the AMI workflow
    102. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
    103. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ AMI ID
    104. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
      • Create keypair
        • Save the private key locally
        • ec2-add-keypair <descriptive keypair name>
      • Launch selected instance
        • Using AMI ID and keypair name
        • ec2-run-instances <AMI ID> -k <keypair name>
        • Returns the Instance ID
      • Examine the running instance
        • ec2-describe-instances <instance ID>
    105. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ …
    106. Let’s pick that apart…
    107. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Reservation ID
    108. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … AWS Access Key ID
    109. AWS Access Key ID
    110. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Security Group ID
    111. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Instance ID
    112. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … AMI ID
    113. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … External DNS host name
    114. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Internal DNS host name
    115. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Current state of the instance
    116. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Keypair name
    117. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … AMI Launch Index
    118. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Instance type
    119. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
    120. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Launch time
    121. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/ … Availability Zone ID
    122. Availability zones are a bit complicated…
    123. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
    124. Other IaaS providers may (or may not) have similar capabilities
    125. The point is that, unlike GAE, here is yet another detail that you need to think about
    126. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
      • Open network access to the instance
        • ec2-authorize <security group name> -p <port number>
        • Can include options like restricting access to a specific (public) IP address
          • -s <IP address/CIDR subnet range>
          • Eg. “-s your_public_IP_address/32”* for just your host
        • At a minimum, you need to configure port 22 for SSH access
      • Connect to the instance with SSH
        • ssh –i <private keyfile> root@<public DNS host name>
        • Note: with “ec2-get-console-output”, you can get (among other things) the SSH host key fingerprint, before logging on with SSH. At login, you can compare to be sure there’s no “man in the middle”
      • Begin modifying the instance
    127. Once you’ve modified the image, you “bundle” it (which is a kind of snapshot), upload the bundle to S3, and register it with EC2
    128. There are hundreds of publicly available AMIs for use as templates
    129. And, finally, with some set of your own AMIs, you can begin running instances of your app
    130. And that brings us to the runtime considerations…
    131. AKA – how does your app scale horizontally?
    132. A brief scalability refresher: vertical scalability is “get a bigger box”
    133. Horizontal scalability is “add more copies of the same box”
    134. To put it bluntly, if your app can't efficiently scale in a horizontal fashion, you’re wasting your time on the Cloud
    135. On GAE, under the covers tech like BigTable, GFS and the legendary Map/Reduce are taking care of this for you
    136. In an IaaS context like AWS, you have to solve the problem yourself
    137. EC2 has a SOAP API that you can invoke – whether you do so from outside EC2, or from within a running AMI is irrelevant
    138. Invoking the EC2 API to launch and terminate instances from a running instance gives you the ability to create dynamic horizontal scalability
    139. Your load balancer AMI could start extra instances of your web server AMI to meet demand…
    140. And turn them back off, when demand subsides
    141. And there are numerous ways to exploit this capability
    142. From RightScale to Scalr to Gigaspaces, Hadoop, Terracotta and countless others
    143. Combined with the other elements of AWS, like S3, SQS, EBS and SimpleDB, you can design a system that competes favorably with GAE
    144. This is what “elastic” means
    145. To repeat: this is a LOT more work. ;)
    146. No constraints on language or design (AMIs can be any Linux or Windows server platform, and your app can be anything that runs on those platforms)
    147. A high level architectural model (The core services of AWS provide a foundation, and do constrain your design – for example, you need horizontal scalability)
    148. A specific model of multi-tenancy (AMIs are securely isolated from one another, but the underlying hardware is all shared)
    149. Takes care of very few low level concerns (You roll your own)
    150. Before we wrap up “deploying to AWS”, however, let’s look at some alternatives to the command line tools from Amazon
    151. In terms of managing running instances, and the overall configuration of things, AWS provides its own Web UI
    152. https://console.aws.amazon.com/ec2/home#c=EC2&s=Home
    153. https://console.aws.amazon.com/ec2/home#c=EC2&s=Instances
    154. https://console.aws.amazon.com/ec2/home#c=EC2&s=Images
    155. https://console.aws.amazon.com/ec2/home#c=EC2&s=BundleTasks
    156. http://status.aws.amazon.com/
    157. An ecosystem of 3 rd party providers has emerged around AWS
    158. Some of them are specialized in managing VMs
    159. http://elasticserver.com/
    160. http://elasticserver.com/portals
    161. http://elasticserver.com/site/lamp
    162. http://elasticserver.com/site/lamp
    163. http://elasticserver.com/build-status
    164.  
    165. https://elasticserver.com/ec2/
    166.  
    167.  
    168. https://elasticserver.com/byo/create
    169. https://elasticserver.com/my/packages
    170. https://elasticserver.com/new-server
    171. There are other vendors offering similar services, eg. rPath
    172. And there is a spectrum between the simplicity of GAE and the complexity of AWS…
    173. Let’s take a look at Elastra, for example
    174. https://cloud.elastra.com/elastra/
    175. https://cloud.elastra.com/elastra/
    176. https://cloud.elastra.com/elastra/
    177. https://cloud.elastra.com/elastra/
    178. https://cloud.elastra.com/elastra/
    179. https://cloud.elastra.com/elastra/
    180. https://cloud.elastra.com/elastra/
    181. Finally, to wrap up our quick overview of IaaS, let’s look at Rightscale…
    182. https://my.rightscale.com/dashboard
    183. https://my.rightscale.com/dashboard
    184. https://my.rightscale.com/dashboard
    185. https://my.rightscale.com/dashboard
    186. https://my.rightscale.com/dashboard
    187. https://my.rightscale.com/dashboard
    188. https://my.rightscale.com/dashboard
    189. https://my.rightscale.com/dashboard
    190. Goals for the workshop
    191. But first, a short break… (Jeopardy theme song plays)
    192. Goals for the workshop
    193. What are some of the questions you need to answer, to decide between PaaS and Iaas?
    194. How quickly do you need to go to market?
    195. How fast do you need to iterate versions of the app?
    196. What are your pre-existing platform needs, if any?
    197. What are your security, compliance, regulatory requirements?
    198. What is your capacity for system architecture and design work?
    199. SPI Model Freedom FROM Considerations Freedom TO Differentiate http://twitter.com/gblnetwkr SaaS PaaS IaaS
    200. SPI Model POWER of speed and agility POWER to control http://twitter.com/gblnetwkr SaaS PaaS IaaS
    201. Goals for the workshop
    202. What do things really cost?
    203. Simple LAMP app. 1 box as a load balancer / proxy, 4 web server boxes, and one larger box for a database server
    204. $84 / month (6 x Giant) http://laughingsquid.net/hosting/
    205. $900 / month (1 x Biz1 + 4 x Biz1 + 1 x Enterprise II) http://order.1and1.com:80/xml/order/ServerRoot
    206. So, let’s see what the equivalent setup costs on AWS…
    207. Now, AWS bills in units of things like server hours, IOs per month, GB of storage and bandwidth actually used, etc.
    208. http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/
    209. 24 hours × 30 days = ---------------------- 720 hours in a month ---------------------- 720 hours × 5 small AWS Instances = ---------------------- 3600 hours ---------------------- + 720 hours of a large AWS instance + 5000 GB network bandwidth + 3200 GB disk space (added to the default space on the instances) + 50 mil. IORs + 30 daily backups ---------------------- roughly equivalent to 1+1 …
    210. $2233 / month http://calculator.s3.amazonaws.com/calc5.html
    211. http://calculator.s3.amazonaws.com/calc5.html
    212. Despite best efforts, this is still quite imprecise, and apples vs. oranges, but…
    213. Even more importantly…
    214. This is an incredibly stupid way to set up and use AWS
    215. $528/ month http://calculator.s3.amazonaws.com/calc5.html
    216. Still not “cheap”, though…
    217. That’s because the key to “elastic computing” isn’t being able to turn on servers at will…
    218. It’s about being able to turn them off .
    219. Let’s rewind to the an earlier part of this discussion…
    220. What’s a web app?
    221. Whatever it is, we said “it’s not static content”…
    222. And I said that makes a big difference
    223. Why is that? Well, the unwritten social contract of the ‘Net says: “you can’t turn static content off”
    224. Apps do something
    225. But they generally don’t do it 24x7
    226. Slicing and dicing your design to strictly demarcate static content from active has always been a Good Idea ™
    227. In a cloud computing context, it’s not just a good idea – it’s imperative
    228. What are your usage patterns? When are your peak loads, on average?
    229. What can you turn off?
    230. And you have to be clever about it…
    231. Your production usage may not even be the place you can save the most money…
    232. Consider: you want to develop the next version of your app
    233. You need resources for your developers to do that, and you need a place for them to test
    234. So, maybe you wind up renting 3 more servers from 1+1 – $300 / month
    235. But, when you examine usage patterns, you find that your developers are only using the boxes for 3 hours each day
    236. $17/ month http://calculator.s3.amazonaws.com/calc5.html
    237. Perhaps even more importantly, you’ve made no commitment here – once your dev / test phase is over, so are the costs
    238. Calculating costs is complex, and entirely context dependent
    239. There are significant potential savings, but only if you’re clever
    240. Goals for the workshop
    241. Since we worked out, sometime in the early ‘90s, what the architecture of a “client / server” system design looked like…
    242. There's been a general consensus about a sort of a canonical architecture for so-called “N-tier systems”
    243. Presentation Service Facáde Application Logic Data Persistence
    244. Web Server App Server Database Server
    245. So, we’ve talked about the need for horizontal scalability in the Cloud
    246. What does that imply?
    247. Well, as already suggested, among other things, parallelism
    248. Parallelism has significant consequences
    249. It leads one to try to avoid stateful interactions
    250. To prefer asynchronous communications (messages)…
    251. One finds oneself on the front lines of the REST War ™ – the battle of the RESTafarians vs. the established IT Universe http://www.dehora.net/journal/2008/07/25/patterns-of-web-architecture/ http://www.dehora.net/journal/2008/08/15/rest-as-an-engineering-discipline/ http://www.infoq.com/articles/webber-rest-workflow/ http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven/ http://www.redmonk.com/jgovernor/2009/02/12/the-rest-of-the-cloud/ http://delicious.com/mastermark/rest/
    252. And it forces one to think strange things about optimal patterns of storing and accessing data
    253. Like sharding one’s data to meet resource demands http://highscalability.com/unorthodox-approach-database-design-coming-shard/
    254. Questions like “is two-phase commit a feature? Or a bug?” begin to seem important
    255. New terms, like CAP, Paxos and BASE creep into conversations about “eventual consistency” http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.20.1495 http://en.wikipedia.org/wiki/Paxos_algorithm http://queue.acm.org/detail.cfm?id=1394128 http://www.allthingsdistributed.com/2008/12/eventually_consistent.html
    256. This was happening anyway, driven by the clash of Web architecture with the established IT universe
    257. Cloud computing’s possibilities are accelerating the process
    258. There is an emerging consensus about what the consequences of all this are for app architectures
    259. “ The canonical cloud architecture that has evolved revolves around dynamically scalable CPUs consuming asynchronous, persistently queued events.” http://highscalability.com/canonical-cloud-architecture
    260. http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1632&categoryID=102
      • Use scalable ingredients
        • Eg. Hadoop on EC2
      • Keep ingredients loosely coupled
        • All communication via persistent messaging
      • Assume constant failure
        • Design things to persist state, restart from last known good, and continue their own tasks even if all around them fail
        • Consider things like re-tries with exponential back-off
        • Build IN redundancy
      • Learn about things like the POSA Blackboard pattern, tuplespaces, and Map / Reduce
    261. Read this book! http://www.amazon.com/How-Write-Parallel-Programs-Course/dp/026203171X/
    262. And if your needs / budget require or can accommodate it, consider RAIC
    263. Redundant Array of Independent Cloud providers http://www.jroller.com/MasterMark/entry/raic_pronounce_it_rake_please
    264. http://www.jroller.com/MasterMark/entry/raic_pronounce_it_rake_please
    265. Why bother?
    266. Web Server App Server Database Server
    267. Mainframe
    268. http://www.flickr.com/photos/dvdmerwe/231593469/
    269. http://www.flickr.com/photos/sigkyrre/1091616886/
    270. http://twitter.com/ gblnetwkr http://en.wikipedia.org/wiki/ Consumerization
    271. http://twitter.com/ gblnetwkr
    272. Join the conversation: http://groups.google.com/group/cloud-computing/ http://groups.google.com/group/cloudforum http://tech.groups.yahoo.com/group/cloudcomputing-tech/ … and please come talk to us, as well … http://twitter.com/mastermark http://www.jroller.com/MasterMark/ Thanks!

    + Mark MastersonMark Masterson, 9 months ago

    custom

    3451 views, 15 favs, 9 embeds more stats

    Slides for an introductory workshop on cloud comput more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3451
      • 2842 on SlideShare
      • 609 from embeds
    • Comments 0
    • Favorites 15
    • Downloads 220
    Most viewed embeds
    • 404 views on http://events.carsonified.com
    • 155 views on http://www.jroller.com
    • 30 views on http://itlab.wordpress.com
    • 10 views on http://members.webmaster-business-guide.com
    • 6 views on http://jroller.com

    more

    All embeds
    • 404 views on http://events.carsonified.com
    • 155 views on http://www.jroller.com
    • 30 views on http://itlab.wordpress.com
    • 10 views on http://members.webmaster-business-guide.com
    • 6 views on http://jroller.com
    • 1 views on http://localhost:8080
    • 1 views on http://nissimbe.blogspot.com
    • 1 views on http://smartdatacollective.com
    • 1 views on http://static.slideshare.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories