Your SlideShare is downloading. ×
Hybrid cloud wiskyweb2012
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Hybrid cloud wiskyweb2012

679
views

Published on

Slides for my Hybrid Cloud talk at Whiskyweb 2012

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
679
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Is Your App Ready For The(Hybrid) Cloud? Thijs Feryn
  • 2. Very%excited%to%be%here%!
  • 3. THIJS
  • 4. TAZE
  • 5. Evangelist
  • 6. @ThijsFeryn
  • 7. Please& rate&my&talk&on& Joind.inhttps://joind.in/6295
  • 8. What%is%Cloud?
  • 9. “That’s(where(rain(comes(from” Andrei%Zmievski
  • 10. Cloud =Internet
  • 11. DefiniIon A%model%for%consumpIon%&% delivery%on%the%internet%where% flexibility%is%essenIal%&%can%be% guaranteed%through% abstracIon
  • 12. Internet%as%a%uIlity
  • 13. Translated%to%what%we%know%&%need
  • 14. Always%available
  • 15. Fast%(enough)
  • 16. Scalability Up%&%down%vs%out%&%in
  • 17. Focus%on%using,%do%what%you’re%good%at
  • 18. Leave%the%rest%to%others
  • 19. Higher%up%the%stack
  • 20. Economic%advantages
  • 21. Less%money Less%effort Less%riskLess%worries
  • 22. Hybrid%let’s%you%do%that
  • 23. Hybrid%is%just%a%fancy%way%of%saying
  • 24. Pick%the%pieces%of%the%puzzle%yourself
  • 25. Amazon%web%services✓CompuIng ✓Database –EC2 –RDS –ELB –DynamoDB –Auto% –SimpleDB scaling –ElasIcache✓Storage –SQS –S3 ✓CDN –EBS –CloudFront Selfservice%Iaas
  • 26. Windows%Azure ✓CompuIng ✓Storage –Blob%storage –Table%storage ✓CDN ✓SQL%Azure ✓Data%sync ✓Service%Bus Selfservice%Paas
  • 27. Orchestra ✓Compu5ng ✓Database –Memcached –MySQL&&&RDS –CouchDB –MongoDB –Redis PHP%Paas%on%top%of%AWS
  • 28. CombellFully%customized%&%managed%soluIons
  • 29. Easy%peasy,%right?
  • 30. Single%point%of%failure
  • 31. Shared%nothing
  • 32. Nothing%is%local
  • 33. Distributed%systems
  • 34. Easy%to%deploy%&%manage?
  • 35. How%do%you% deal%with$_SESSIONS?
  • 36. ReplicaIonR/W%spliang
  • 37. “Cloud(is(for(green(field(projects” Maarten%Balliauw
  • 38. Let’s%do%it%!
  • 39. Infrastructure ✓Basics –Webservers –MySQL%servers –File%servers ✓AddiIonal%servers –Caching%servers –Reverse%proxy%servers ✓External%CDN
  • 40. Single%server%setup
  • 41. Single%server%setup ✓Developer –Everything%is%local •Files •Databases ✓Sysadmin –Sits%back,%drinks%some%coffee
  • 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. Separate% MySQL
  • 44. Separate%MySQL ✓Developer –Change%connecIonstring(s) ✓Sysadmin –Sets%up%separate%server –Tunes%for%MySQL
  • 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. MulIple%MySQL’s
  • 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. 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. 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. 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. MulIple% web%servers
  • 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. Memcached%session%handlersession.save_handler&=&memcachedsession.save_path=&“mc1.myapp.ext:11211,mc2.myapp.ext:11211” php.ini
  • 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. Offload% staIc% files
  • 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. Offload%staIc%files What%✓Amazon about%the% –EC2&instances&for&storage&with& Cloud? clustered&file&system –S3&buckets✓Azure –Blob&storage
  • 58. When% the%pressure% is% on
  • 59. Auto%scaling%&%load%balancing
  • 60. CDN%&%asset%offloading
  • 61. Reverse%(caching)%proxy
  • 62. Memcached
  • 63. Adapt yourcode
  • 64. Storage
  • 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. <?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. <?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. Design% paoerns Modular& e.g. AbstracIon% designDependency& injec5on layers
  • 69. +%W3%Total% Cache
  • 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. Deploy%your%code
  • 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. Mix%&%match
  • 74. Management%models%(oAen(forgoBen)
  • 75. Management%models%(oAen(forgoBen) Managed%Cloud%is%the% new%dedicated%server Unmanaged%Cloud%is% virtual%colocaIon
  • 76. Management%models%(oAen(forgoBen) Custom%soluIon%at%hoster% under%heavy%SLA Burst%model%at%unmanaged% vendor
  • 77. When%to%choose%what?

×