Is Your App Ready For The(Hybrid) Cloud?          Thijs Feryn
Very%excited%to%be%here%!
THIJS
TAZE
Evangelist
@ThijsFeryn
Please&   rate&my&talk&on&       Joind.inhttps://joind.in/6295
What%is%Cloud?
“That’s(where(rain(comes(from”          Andrei%Zmievski
Cloud    =Internet
DefiniIon  A%model%for%consumpIon%&% delivery%on%the%internet%where% flexibility%is%essenIal%&%can%be%      guaranteed%throu...
Internet%as%a%uIlity
Translated%to%what%we%know%&%need
Always%available
Fast%(enough)
Scalability        Up%&%down%vs%out%&%in
Focus%on%using,%do%what%you’re%good%at
Leave%the%rest%to%others
Higher%up%the%stack
Economic%advantages
Less%money Less%effort  Less%riskLess%worries
Hybrid%let’s%you%do%that
Hybrid%is%just%a%fancy%way%of%saying
Pick%the%pieces%of%the%puzzle%yourself
Amazon%web%services✓CompuIng ✓Database –EC2      –RDS –ELB      –DynamoDB –Auto%    –SimpleDB  scaling  –ElasIcache✓Storag...
Windows%Azure            ✓CompuIng            ✓Storage             –Blob%storage             –Table%storage            ✓CD...
Orchestra            ✓Compu5ng            ✓Database              –Memcached              –MySQL&&&RDS              –CouchD...
CombellFully%customized%&%managed%soluIons
Easy%peasy,%right?
Single%point%of%failure
Shared%nothing
Nothing%is%local
Distributed%systems
Easy%to%deploy%&%manage?
How%do%you%  deal%with$_SESSIONS?
ReplicaIonR/W%spliang
“Cloud(is(for(green(field(projects”          Maarten%Balliauw
Let’s%do%it%!
Infrastructure ✓Basics  –Webservers  –MySQL%servers  –File%servers ✓AddiIonal%servers  –Caching%servers  –Reverse%proxy%se...
Single%server%setup
Single%server%setup ✓Developer  –Everything%is%local   •Files   •Databases ✓Sysadmin  –Sits%back,%drinks%some%coffee
Single%server%setup                                     What%✓Amazon                            about%the% –1%EC2%instance...
Separate% MySQL
Separate%MySQL ✓Developer  –Change%connecIonstring(s) ✓Sysadmin  –Sets%up%separate%server  –Tunes%for%MySQL
Separate%MySQL                                  What%✓Amazon                         about%the% –Extra%EC2%instance%for%My...
MulIple%MySQL’s
MulIple%MySQL’s✓Developer –Read&write&spliEng&in&code –Connect&to&loadbalanced&hostname✓Sysadmin –Setup&servers –Configure&...
MulIple%   Use%mysqlnd_ms%for%R/W%spliang%in%case%of%crappy%codeMySQL’s{%%%%"myapp":%{%%%%%%%%"master":%{%%%%%%%%%%%%"writ...
mysqlnd_ms.enable=1mysqlnd_ms.ini_file=/path/to/mysqlnd_ms_plugin.ini                                              php.ini...
MulIple%MySQL’s                                       What%✓Amazon                              about%the% –Mul5ple&EC2&in...
MulIple% web%servers
MulIple%web%servers✓Developer –Mul5ple&places&to&deploy –Where&are&my&sta5c&assets? –Sessions?✓Sysadmin –Mul5ple&servers&b...
Memcached%session%handlersession.save_handler&=&memcachedsession.save_path=&“mc1.myapp.ext:11211,mc2.myapp.ext:11211”     ...
MulIple%Web%servers                                       What%✓Amazon                              about%the% –Mul5ple&EC...
Offload% staIc%  files
Offload%staIc%files✓Developer –Sync&current&assets –Store&new&files&on&external&servers –Use&external&hostname&when&referencin...
Offload%staIc%files                                      What%✓Amazon                             about%the% –EC2&instances&f...
When%     the%pressure%       is%      on
Auto%scaling%&%load%balancing
CDN%&%asset%offloading
Reverse%(caching)%proxy
Memcached
Adapt yourcode
Storage
require_once*Zend/Service/WindowsAzure/Storage/Blob.php;*$storageClient*=*new*Zend_Service_WindowsAzure_Storage_Blob();$re...
<?php$storage = Zend_Cloud_StorageService_Factory::getAdapter(array(    Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER...
<?php$storage = Zend_Cloud_StorageService_Factory::getAdapter(array(    Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER...
Design%    paoerns                            Modular&    e.g.              AbstracIon%    designDependency& injec5on     ...
+%W3%Total% Cache
W3%Total%Cache✓Page&caching& d Memcached&(loadbalanced) d Varnish&(loadbalanced)✓Database&&&object&cache d Memcached&(load...
Deploy%your%code
Deploy%your%code✓General%deployment%methods –Capistrano –Phing –Puppet%(config%is%code%too) –Version%control%tools✓Amazon%s...
Mix%&%match
Management%models%(oAen(forgoBen)
Management%models%(oAen(forgoBen)    Managed%Cloud%is%the%    new%dedicated%server     Unmanaged%Cloud%is%      virtual%co...
Management%models%(oAen(forgoBen)   Custom%soluIon%at%hoster%       under%heavy%SLA Burst%model%at%unmanaged%          ven...
When%to%choose%what?
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Hybrid cloud wiskyweb2012
Upcoming SlideShare
Loading in …5
×

Hybrid cloud wiskyweb2012

1,022 views
925 views

Published on

Slides for my Hybrid Cloud talk at Whiskyweb 2012

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,022
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Hybrid cloud wiskyweb2012

  1. 1. Is Your App Ready For The(Hybrid) Cloud? Thijs Feryn
  2. 2. Very%excited%to%be%here%!
  3. 3. THIJS
  4. 4. TAZE
  5. 5. Evangelist
  6. 6. @ThijsFeryn
  7. 7. Please& rate&my&talk&on& Joind.inhttps://joind.in/6295
  8. 8. What%is%Cloud?
  9. 9. “That’s(where(rain(comes(from” Andrei%Zmievski
  10. 10. Cloud =Internet
  11. 11. DefiniIon A%model%for%consumpIon%&% delivery%on%the%internet%where% flexibility%is%essenIal%&%can%be% guaranteed%through% abstracIon
  12. 12. Internet%as%a%uIlity
  13. 13. Translated%to%what%we%know%&%need
  14. 14. Always%available
  15. 15. Fast%(enough)
  16. 16. Scalability Up%&%down%vs%out%&%in
  17. 17. Focus%on%using,%do%what%you’re%good%at
  18. 18. Leave%the%rest%to%others
  19. 19. Higher%up%the%stack
  20. 20. Economic%advantages
  21. 21. Less%money Less%effort Less%riskLess%worries
  22. 22. Hybrid%let’s%you%do%that
  23. 23. Hybrid%is%just%a%fancy%way%of%saying
  24. 24. Pick%the%pieces%of%the%puzzle%yourself
  25. 25. Amazon%web%services✓CompuIng ✓Database –EC2 –RDS –ELB –DynamoDB –Auto% –SimpleDB scaling –ElasIcache✓Storage –SQS –S3 ✓CDN –EBS –CloudFront Selfservice%Iaas
  26. 26. Windows%Azure ✓CompuIng ✓Storage –Blob%storage –Table%storage ✓CDN ✓SQL%Azure ✓Data%sync ✓Service%Bus Selfservice%Paas
  27. 27. Orchestra ✓Compu5ng ✓Database –Memcached –MySQL&&&RDS –CouchDB –MongoDB –Redis PHP%Paas%on%top%of%AWS
  28. 28. CombellFully%customized%&%managed%soluIons
  29. 29. Easy%peasy,%right?
  30. 30. Single%point%of%failure
  31. 31. Shared%nothing
  32. 32. Nothing%is%local
  33. 33. Distributed%systems
  34. 34. Easy%to%deploy%&%manage?
  35. 35. How%do%you% deal%with$_SESSIONS?
  36. 36. ReplicaIonR/W%spliang
  37. 37. “Cloud(is(for(green(field(projects” Maarten%Balliauw
  38. 38. Let’s%do%it%!
  39. 39. Infrastructure ✓Basics –Webservers –MySQL%servers –File%servers ✓AddiIonal%servers –Caching%servers –Reverse%proxy%servers ✓External%CDN
  40. 40. Single%server%setup
  41. 41. Single%server%setup ✓Developer –Everything%is%local •Files •Databases ✓Sysadmin –Sits%back,%drinks%some%coffee
  42. 42. Single%server%setup What%✓Amazon about%the% –1%EC2%instance Cloud? –Local%MySQL%or%RDS%(as%a%service) –Local%files✓Azure –Single%App%deployment –Include%PHP%&%MySQL%in%package%script✓Orchestra –Single%App%deployment –Request%MySQL%database%or%RDS
  43. 43. Separate% MySQL
  44. 44. Separate%MySQL ✓Developer –Change%connecIonstring(s) ✓Sysadmin –Sets%up%separate%server –Tunes%for%MySQL
  45. 45. Separate%MySQL What%✓Amazon about%the% –Extra%EC2%instance%for%MySQL Cloud? –RDS✓Azure –MySQL%deployment%with%worker%role –Doesn’t%scale%well –Use%SQL%Azure%instead✓Orchestra –By%default%separate –Create%separate%MySQL%database –RDS
  46. 46. MulIple%MySQL’s
  47. 47. MulIple%MySQL’s✓Developer –Read&write&spliEng&in&code –Connect&to&loadbalanced&hostname✓Sysadmin –Setup&servers –Configure&replica5on •Master/master •Master/slave –Add&to&loadbalancing
  48. 48. MulIple% Use%mysqlnd_ms%for%R/W%spliang%in%case%of%crappy%codeMySQL’s{%%%%"myapp":%{%%%%%%%%"master":%{%%%%%%%%%%%%"write_group":%{%%%%%%%%%%%%%%%%"host":%"master.db.myapp.ext",%%%%%%%%%%%%%%%%"port":%"3306"%%%%%%%%%%%%} mysqlnd_ms_plugin.ini%%%%%%%%},%%%%%%%%"slave":%{%%%%%%%%%%%%"read_group":%{%%%%%%%%%%%%%%%%"host":%"slave.db.myapp.ext",%%%%%%%%%%%%%%%%"port":%"3306"%%%%%%%%%%%%}%%%%%%%%}%%%%}}
  49. 49. mysqlnd_ms.enable=1mysqlnd_ms.ini_file=/path/to/mysqlnd_ms_plugin.ini php.ini<?php$mysqli = new mysqli("myapp", "username", "password", "database");$pdo = new PDO(mysql:host=myapp;dbname=database, username, password);$mysql = mysql_connect("myapp", "username", "password"); ConnecIon% string
  50. 50. MulIple%MySQL’s What%✓Amazon about%the% –Mul5ple&EC2&instances& Cloud? with&replica5on&and&loadbalancing –RDS&with&read&replica✓Azure –Include&PHP&&&MySQL&in&package&script –Doesn’t&scale –Use&SQL&Azure✓Orchestra –RDS –Xeround
  51. 51. MulIple% web%servers
  52. 52. MulIple%web%servers✓Developer –Mul5ple&places&to&deploy –Where&are&my&sta5c&assets? –Sessions?✓Sysadmin –Mul5ple&servers&behind&loadbalancer –$_SESSION&clustering&via&Memcached&or& s5cky&sessions –Shared&storage
  53. 53. Memcached%session%handlersession.save_handler&=&memcachedsession.save_path=&“mc1.myapp.ext:11211,mc2.myapp.ext:11211” php.ini
  54. 54. MulIple%Web%servers What%✓Amazon about%the% –Mul5ple&EC2&instances& Cloud? –Use&ELB&for&loadbalancing –AMI&for&easy&setup –Config&management&(puppet,&chef,&...)✓Azure –Out&of&the&box –Tuning&possible✓Orchestra –Out&of&the&box
  55. 55. Offload% staIc% files
  56. 56. Offload%staIc%files✓Developer –Sync&current&assets –Store&new&files&on&external&servers –Use&external&hostname&when&referencing& files✓Sysadmin –Tune&external&servers&for&sta5c&content –CDN,&perhaps?
  57. 57. Offload%staIc%files What%✓Amazon about%the% –EC2&instances&for&storage&with& Cloud? clustered&file&system –S3&buckets✓Azure –Blob&storage
  58. 58. When% the%pressure% is% on
  59. 59. Auto%scaling%&%load%balancing
  60. 60. CDN%&%asset%offloading
  61. 61. Reverse%(caching)%proxy
  62. 62. Memcached
  63. 63. Adapt yourcode
  64. 64. Storage
  65. 65. require_once*Zend/Service/WindowsAzure/Storage/Blob.php;*$storageClient*=*new*Zend_Service_WindowsAzure_Storage_Blob();$result*=*$storageClientE>putBlob(testcontainer,*example.txt,*/example.txt);*echo*Blob*name*is:**.*$resultE>Name; Azure% Blog%storagerequire_once*Zend/Service/Amazon/S3.php;*$s3*=*new*Zend_Service_Amazon_S3($my_aws_key,*$my_aws_secret_key);*$s3E>createBucket("myEownEbucket");*$s3E>putObject("myEownEbucket/myobject",*"somedata");echo*$s3E>getObject("myEownEbucket/myobject"); Amazon% S3
  66. 66. <?php$storage = Zend_Cloud_StorageService_Factory::getAdapter(array(    Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY => Zend_Cloud_StorageService_Adapter_S3,    Zend_Cloud_StorageService_Adapter_S3::AWS_ACCESS_KEY   => $amazonKey,    Zend_Cloud_StorageService_Adapter_S3::AWS_SECRET_KEY   => $amazonSecret,));$data = file_get_contents(/my/local/dir/picture.jpg);$returnedData = $storage->storeItem(/my/remote/path/picture.jpg, $data); Supports% Azure%&%AWS
  67. 67. <?php$storage = Zend_Cloud_StorageService_Factory::getAdapter(array(    Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY => Zend_Cloud_StorageService_Adapter_FileSystem,    Zend_Cloud_StorageService_Adapter_FileSystem::LOCAL_DIRECTORY   => $localDirectory,));$data = file_get_contents(/my/local/dir/picture.jpg);$returnedData = $storage->storeItem(/my/remote/path/picture.jpg, $data); Even% Put% supports%local% opIons%in% file%system config%file
  68. 68. Design% paoerns Modular& e.g. AbstracIon% designDependency& injec5on layers
  69. 69. +%W3%Total% Cache
  70. 70. W3%Total%Cache✓Page&caching& d Memcached&(loadbalanced) d Varnish&(loadbalanced)✓Database&&&object&cache d Memcached&(loadbalanced)✓CDN d Push&to&S3&or&Azure&Blob&storage&buckets d Pull&from&CDN&(CloudFront(or(Azure) d Custom&hostnames✓Scale&across&EC2&nodes&with&ELB
  71. 71. Deploy%your%code
  72. 72. Deploy%your%code✓General%deployment%methods –Capistrano –Phing –Puppet%(config%is%code%too) –Version%control%tools✓Amazon%specific –AMI’s✓Azure%specific –Scaffolding%&%packaging%%command%line%tool –Upload%packages%in%control%panel✓Orchestra%specific –Git
  73. 73. Mix%&%match
  74. 74. Management%models%(oAen(forgoBen)
  75. 75. Management%models%(oAen(forgoBen) Managed%Cloud%is%the% new%dedicated%server Unmanaged%Cloud%is% virtual%colocaIon
  76. 76. Management%models%(oAen(forgoBen) Custom%soluIon%at%hoster% under%heavy%SLA Burst%model%at%unmanaged% vendor
  77. 77. When%to%choose%what?

×