Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Php Development In The Cloud


Published on

An overview of cloud computing for PHP developers.

This is a slightly updated version of my earlier 'PHP and the Cloud' slides, mostly to reflect my new company's layout.

Published in: Technology
  • If we talk about Cloud Hosting, I think it's lot better than other types of hosting because of the benefits we get. I mean vertical scaling is one of the best thing to come in hosting. You can up or down scale you CPU or RAM anytime you want. This minimized the chances of your website getting crashed because of spike in traffic. The only problem with cloud hosting is that it is complicated to host application on it. You need a sysadmin for that and even with that it will be a quite time intensive task. However, if you are using a managed hosting platform, like Cloudways, you will not have to spend so much time or efforts on all this. You can host your PHP apps on cloud within minutes.
    Are you sure you want to  Yes  No
    Your message goes here
  • its good one...
    Are you sure you want to  Yes  No
    Your message goes here

Php Development In The Cloud

  1. 1. @egeniqPHP Development In The Cloud Ivo Jansch February 2011
  2. 2. Contents WARNING This is not Yet Another “Store files on Amazon S3” talk. 2
  3. 3. What is the Cloud? 3
  4. 4. What is the Cloud? 4
  5. 5. Gartner’s Hype Cycle 5
  6. 6. Gartner’s Hype Cycle 6
  7. 7. Gartner’s Hype Cycle on Clouds 7
  8. 8. Clouds According to NIST “Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources that can be rapidly provisioned and released with minimal management effort or service provider interaction. This cloud model promotes availability and is composed of five essential characteristics, three service models, and four deployment models.” National Institute of Standards and Technology 8
  9. 9. NIST: Five CharacteristicsThings that are considered cloud:‣ On-demand, self-service‣ Broad network access‣ Resource pooling‣ Rapid elasticity‣ Measured service 9
  10. 10. NIST: Three Service ModelsCloud applications are:‣ Software as a Service‣ Platform as a Service‣ Infrastructure as a Service 10
  11. 11. NIST: Four Deployment Models‣ Private cloud‣ Community cloud‣ Public cloud‣ Hybrid cloud 11
  12. 12. Infrastructure as a Service 12
  13. 13. Application LayersStandard layers in a typical application: Application System Software Storage Operating System Hardware Network 13
  14. 14. Infrastructure as a ServiceParts of the infrastructure offered as service to your app: Application System Software Storage Operating System Hardware Network 14
  15. 15. Infrastructure as a Service‣ Pitfalls: • Vendor lock-in • Security • Integrity of the service provider‣ Advantages: • Easily scalable • Move from capital expense to operational expense • Metered use • Don’t worry about hardware... 15
  16. 16. Infrastructure as a Service 16
  17. 17. The Hardware/OS Layer‣ Typically offered as Virtual Machine images‣ Gives ‘throw hardware at the problem’ a new dimension‣ Elastic load balancing divides traffic over instances 17
  18. 18. Example: The Rackspace Cloud‣ The RackspaceCloud is what used to be called Mosso‣ Powerful API for managing your cloud‣ Easy access in PHP through Aleksey Korzun’s PHP API: •‣ Concepts • Images (various operating systems) • Flavors (configuration: mem, cpu, disk) 18
  19. 19. The Rackspace Cloud in PHP 19
  20. 20. The Rackspace Cloud in PHP 20
  21. 21. Clouds for Development‣ Private Cloud: • Flexible development environments • Easy to simulate large scale environments • Easy to set up multiple clusters 21
  22. 22. Example: Terremark’s Infinicloud 22
  23. 23. Terremark’s InfiniCloud 23
  24. 24. IaaS ArchitecturePrepare your app to run on IaaS 24
  25. 25. Horizontal Scalability‣ If you run your app on multiple servers today, would it work?‣ Typical problem areas: • Sessions • Files 25
  26. 26. Horizontal Scalability‣ Danga - • People behind LiveJournal / SixApart • Creators of tools to help make software horizontally scalable • Memcache - distributed caching, session clustering ‣ • MogileFS - distributed file storage ‣ • Gearman - distributed parallel job processing / message queue ‣ 26
  27. 27. Elasticity‣ Fewer bottlenecks • More elasticity • Easier to scale 27
  28. 28. Elasticity 28
  29. 29. Elasticity 29
  30. 30. Abstraction ‣ Abstract services where possible 30
  31. 31. Abstraction‣ Con: • Common denominator functionality • Adds some overhead‣ Pro: • Reduce vendor lock-in • Increase flexibility • Save development time • No need to learn different APIs • Promotes competition between providers 31
  32. 32. Abstraction‣ Zend’s SimpleCloud • • Good attempt at generic cloud abstraction 32
  33. 33. Characteristics Of Your Application‣ Service oriented‣ Stateless‣ Low coupling‣ Modularity‣ Interoperability 33
  34. 34. Infra as a Service = SLA Hell?‣ Find out service levels of infrastructure components‣ Get proper support‣ Create “What if...” scenarios • What if Amazon is down? • What if SupaDupaCloudStore goes bankrupt?‣ Who owns the data?‣ Pay attention to license agreements 34
  35. 35. Platform as a Service 35
  36. 36. Platform as a ServiceComplete platform offered as a service: Application System Software Storage Operating System Hardware Network 36
  37. 37. Platform as a Service‣ Platform scales up and down as necessary‣ Same pitfalls and advantages as IaaS, plus: • Don’t worry about scalability 37
  38. 38. Platform as a Service 38
  39. 39. Google AppEngine‣‣ Python and Java‣ Able to run PHP via Quercus (Java PHP interpreter) • •‣ Technology needs to prove itself • Example sites running on Quercus: ‣ ‣ 39
  40. 40. The Rackspace Cloud ‘Sites’ 40
  41. 41. Rackspace’s TrueHybrid‣ Platform selects the best operating system for your site‣ Magically blends Windows and Linux, ASP.NET and PHP 41
  42. 42. Other Platforms for PHP‣ NING • • Social Network PaaS‣ • Salesforce cloud platform • Business applications‣ PHPFog • • Cloud platform for PHP apps • Quite young, looks very promising 42
  43. 43. Software as a Service 43
  44. 44. Software as a ServiceEverything in the cloud: Application System Software Storage Operating System Hardware Network 44
  45. 45. Software as a Service‣ Complete applications or application components‣ Popular phrase: “We are moving our ... to the cloud”‣ Examples: • Gmail • Google Apps (office apps, calendar, email) • Salesforce for CRM‣ Often built on IaaS • Dropbox file sharing (makes use of Amazon S3 for storage) • Jungledisk backups (same) 45
  46. 46. Software as a Service 46
  47. 47. Example: Salesforce‣ Gives access to all your data in Salesforce using SOAP‣ PHP library available‣ Documentation abundant •‣ Salesforce was SaaS way before term ‘cloud’ was coined‣ Most developer friendly SaaS • Documentation • Sandbox functionality (paid) 47
  48. 48. Example: SalesforceSource adapted from tutorial at 48
  49. 49. Example: Google Apps‣ Many features available through Zend_Gdata_* in ZF • Information retrieval • Document storage • Calendering • Account Configuration 49
  50. 50. Example: Google Apps 50
  51. 51. General SaaS suggestions‣ Want to work with X from PHP? • Google ‘X php api’ or ‘X php tutorial’ • You’re almost never the first to want to work with it‣ Cloud apps are easier to work with than most desktop/ noncloud apps.‣ Testing • You don’t want to jeopardize your production data • See if there is a sandbox feature (Salesforce has one) • If not, create test accounts 51
  52. 52. The ‘Warcraft Effect’ Clouds are living entities that change when you’re not looking 52
  53. 53. Creating SaaS 53
  54. 54. Creating SaaS‣ In 2 years Cloud Infrastructure will be a commodity • It’ll be all about application development‣ Building an application for multiple users/customers‣ Things to pay attention to: • Reliability (one customer getting in the way of another) • Security (competitors seeing each other’s data) • Deployment • Maintenance 54
  55. 55. Multi-Tenancy evolutionSource: 55
  56. 56. Multi-tenant Databases 56
  57. 57. Multi-tenant Databases 57
  58. 58. Things to think about‣ Privacy‣ Shared data‣ Collaboration‣ Interoperability‣ Vendor lock 58
  59. 59. Putting it all together Cloud Computing In Practice 59
  60. 60. A Hybrid IT Cloud 60
  61. 61. A Hybrid IT Cloud 61
  62. 62. SummaryIf you were sleeping, wake up now! 62
  63. 63. Summary‣ What is the Cloud? • The cloud = IaaS + PaaS + SaaS‣ If you have trouble remembering: • Cloud = Platform, Infrastructure & Software as a Service 63
  64. 64. Summary‣ With your next PHP application: • See if you can run it on a Cloud Platform • See if you can run parts on Cloud Infrastructure • See if you can use Software as a Service components • See if you can offer it as a service • Keep your architecture ‘cloud ready’‣ Think about clouds! • In a couple of years, we’ll all be doing it 64
  65. 65. Food for ThoughtLet’s leave you with something to think about 65
  66. 66. Food for ThoughtAre you worried about this? Cloud Cloud Provider Where’s my data?! 66
  67. 67. Food for ThoughtThen what about this? Financial System Bank Where’s my money?! Our money has been in the cloud since the 18th century! 67
  68. 68. @egeniqThank you! Questions? @ijansch
  69. 69. CreditsPictures used (under Creative Commons Attribution licenses)Cloud (slide 3): + harddisk: (adapted)Rubber Band Man: used (royalty free and public domain)