9. Cloud
“Cloud computing is a model for enabling convenient, ondemand
network access to a shared pool of configurable computing
resources (e.g., networks, servers, storage, applications, and
services) 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.”
http://csrc.nist.gov/groups/SNS/cloudcomputing/
9
10. Cloud
“Cloud computing is a model for enabling convenient, ondemand
network access to a shared pool of configurable computing
resources (e.g., networks, servers, storage, applications, and
services) 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.”
http://csrc.nist.gov/groups/SNS/cloudcomputing/
10
11. PHP and the Cloud
• Convenient network access
– CURL extension
• Connect and communicate to many different types of
servers
• http, https, ftp, gopher, telnet, dict, file, and ldap
protocols
• Most prevalent within the cloud: HTTP
• RESTful services (POST, GET, PUT, DELETE)
11
13. PHP and the Cloud
• Convenient network access
– SOAP extension
• SoapClient, SoapServer
• Simple Object Access Protocol
• WSDL: Web Services Description Language
$hello = new SoapClient("http://api.cloudphp.net/Hello.wsdl");
$hello->sayHello("world");
13
14. Cloud
“Cloud computing is a model for enabling convenient, ondemand
network access to a shared pool of configurable computing
resources (e.g., networks, servers, storage, applications, and
services) 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.”
http://csrc.nist.gov/groups/SNS/cloudcomputing/
14
15. PHP and the Cloud
• Configurable computing resources
– Usually, requests sent as POST
– Obtain options available
– XML with SimpleXML or DOM extension
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book title="PHP in the Cloud" pages="100" />
</books>
$xml = simplexml_load_string($content);
$title = $xml->book["title"];
$title = $xml->book["pages"];
15
16. PHP and the Cloud
• Configurable computing resources
– JSON extension
– json_encode() / json_decode()
– Javascript Object Notation
– Very popular interchange format:
• More compact
• Interpretable by Javascript
• AJAX requests
16
17. PHP and the Cloud
• Configurable computing resources
– JSON extension
{
"book":{
"title":"PHP in the Cloud",
"pages":"100"
}
}
$json = json_decode($jcontent);
echo $json->book->title;
echo $json->book->pages;
17
19. Infrastructure as a Service
• Typically VM instances
• Choice of OS
• Freedom within the OS
• Some custom network features
• Instances controlled via API
• Specialised or custom Machine Images
19
20. Infrastructure as a Service
• Publicly available examples:
– Amazon Elastic Compute Cloud
– Rackspace Cloud Servers
– Microsoft Azure
• PHP API provided by each vendor
• Open source PHP alternatives are abundant
(and sometimes better!)
20
29. PHP and Google AppEngine
• PseudoPHP via Quercus
– Lacks community involvement:
• PHP core and PECL community consists of a large
band of contributors from around the world
• Opensource solutions provided by the community
(such as extensions) are well embraced
• Many extensions not available
29
31. PHP and Rackspace Sites
• Downside:
– No instant control over supported version
– Unsuitable for custom requirements
• No shell access
• Not able to build custom libraries
– No API
31
32. Software as a Service
• GUI and API Almost always:
– Google Apps
“There is a PHP wrapper for that”
– Salesforce
– Twitter
– Google Maps
– Google Search
• API Only: PayflowPro
32
33. PHP for SaaS
• PHP's Bread and Butter
• Architectural considerations
• Multitenancy
• Be careful:
– Reliability
– Security
– Deployment
– Maintenance
33
35. PHP for the Cloud
• Compatible philosophies
– The Unix Philosophy: Write programs that do
one thing and do it well. Write programs to
work together. Write programs to handle text
streams, because that is a universal interface.
35
36. What PHP is?
• Do one thing and do it well
– An easier interface (wrapper) to C (and other)
libraries
“Rails is like a rounded rectangle and PHP is like a ball of nails.”
Terry Chay
36
37. What PHP is?
• Work together
– Extensions
• Gmagick → GraphicsMagick
• CURL → libcurl
• memcached → libmemcached
• See pecl.php.net
– Web servers
• httpd
– Browsers and UIs (e.g. GTK)
37
38. Credits and sources
Photos and Images
Gartner's Hype Cycle illustrative diagram on slide 7 & 8 by Jeremy Kemp on Wikipedia
Trees on slide 18 by Gerald_G on http://www.openclipart.org/
Cachegrind generated 22 from xdebug (by Derick Rethans) used to generate visualisation
created with xdebugtoolkit and dot
Rack on slide 28 by Steve Jurvetson. Source: http://flickr.com/photos/jurvetson/157722937/
Fort on slide 34 by Jan F. on Wikipedia
UNIX License plate on slide 35 from http://www.unix.org/
Old images on slide 28, 30, 33 from http://www.oldbookillustrations.com
All other organisational logos are trademark of the respective organisations
38