Develop	  &	  deploy	  using	  hybrid	  cloud	  strategiesThijs	  FerynEvangelist+32	  (0)9	  218	  79	  06thijs@combellgr...
Very	  excited	  to	  be	  here	  !
THIJS
TAZE
Evangelist
@ThijsFeryn
Please	     rate	  my	  talk	  on	         Joind.inhttps://joind.in/4951
What	  is	  Cloud?
“That’s	  where	  rain	  comes	  from”               Andrei	  Zmievski
Cloud    =Internet
DefiniXon  A	  model	  for	  consumpXon	  &	   delivery	  on	  the	  internet	  where	   flexibility	  is	  essenXal	  &	  c...
Internet	  as	  a	  uXlity
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 ✓CompuXng ✓Database  –EC2       –RDS  –ELB       –DynamoDB  –Auto	    –SimpleDB   scaling   –ElasX...
Windows	  Azure               ✓CompuXng               ✓Storage                –Blob	  storage                –Table	  stor...
Orchestra            ✓CompuXng            ✓Database              –Memcached              –MySQL	  &	  RDS              –Co...
CombellFully	  customized	  &	  managed	  soluXons
Easy	  peasy,	  right?
Single	  point	  of	  failure
Shared	  nothing
Nothing	  is	  local
Distributed	  systems
Easy	  to	  deploy	  &	  manage?
How	  do	  you	    deal	  with$_SESSIONS?
ReplicaXonR/W	  splimng
“Cloud	  is	  for	  green	  field	  projects”                Maarten	  Balliauw
Let’s	  do	  it	  !
Infrastructure ✓Basics  –Webservers  –MySQL	  servers  –File	  servers ✓AddiXonal	  servers  –Caching	  servers  –Reverse	...
Single	  server	  setup
Single	  server	  setup ✓Developer  –Everything	  is	  local   •Files   •Databases ✓Sysadmin  –Sits	  back,	  drinks	  som...
Single	  server	  setup                                                      What	  ✓Amazon                               ...
Separate	   MySQL
Separate	  MySQL ✓Developer  –Change	  connecXonstring(s) ✓Sysadmin  –Sets	  up	  separate	  server  –Tunes	  for	  MySQL
Separate	  MySQL                                             What	  ✓Amazon                                    about	  the...
MulXple	  MySQL’s
MulXple	  MySQL’s✓Developer –Read	  write	  splimng	  in	  code –Connect	  to	  loadbalanced	  hostname✓Sysadmin –Setup	  ...
MulXple	     Use	  mysqlnd_ms	  for	  R/W	  splimng	  in	  case	  of	  crappy	  codeMySQL’s{	  	  	  	  "myapp":	  {	  	  ...
mysqlnd_ms.enable=1mysqlnd_ms.ini_file=/path/to/mysqlnd_ms_plugin.ini                                              php.ini...
MulXple	  MySQL’s                                                         What	  ✓Amazon                                  ...
MulXple	   web	  servers
MulXple	  web	  servers✓Developer –MulXple	  places	  to	  deploy –Where	  are	  my	  staXc	  assets? –Sessions?✓Sysadmin ...
Memcached	  session	  handlersession.save_handler	  =	  memcachedsession.save_path=	  “mc1.myapp.ext:11211,mc2.myapp.ext:1...
MulXple	  Web	  servers                                                   What	  ✓Amazon                                  ...
Offload	   staXc	    files
Offload	  staXc	  files✓Developer –Sync	  current	  assets –Store	  new	  files	  on	  external	  servers –Use	  external	  ho...
Offload	  staXc	  files                                                     What	  ✓Amazon                                   ...
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_...
<?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	       pawerns                                  Modular	      e.g.                 AbstracXon	      designDependenc...
+	  W3	  Total	   Cache
W3	  Total	  Cache✓Page	  caching	   -­‐ Memcached	  (loadbalanced) -­‐ Varnish	  (loadbalanced)✓Database	  &	  object	  c...
Deploy	  your	  code
Deploy	  your	  code✓General	  deployment	  methods  –Capistrano  –Phing  –Puppet	  (config	  is	  code	  too)  –Version	  ...
About	  Azure	  deployment
About	  Azure	  deploymentscaffolder	  run	  -­‐out="c:tempHelloAzureProject"package	  create	  -­‐in="C:tempHelloAzurePro...
About	  Azure	  deployment                           Semngs.iniCertificate=XXXXXXXXSubscriptionId=XXXXXPassphrase=XXXXXXXX...
About	  Azure	  deploymentdeployment.php	  CreateFromLocal	  -­‐-­‐ConfigFile="settings.ini"	  -­‐-­‐Name="mysubdomain"	  ...
About	  Azure	  deploymentdeployment.php	  Swap	  -­‐-­‐ConfigFile="settings.ini"	  -­‐-­‐Name="mysubdomain"	  -­‐-­‐WaitF...
Mix	  &	  match
Management	  models	  (oAen	  forgoBen)
Management	  models	  (oAen	  forgoBen)      Managed	  Cloud	  is	  the	        new	  dedicated	  server      Unmanaged	  ...
Management	  models	  (oAen	  forgoBen)   Custom	  soluXon	  at	  hoster	         under	  heavy	  SLA Burst	  model	  at	 ...
When	  to	  choose	  what?
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
Upcoming SlideShare
Loading in...5
×

Develop and deploy using Hybrid Cloud Strategies confoo2012

1,314

Published on

Slides for my Hybrid Cloud talk at Confoo

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

  • Be the first to like this

No Downloads
Views
Total Views
1,314
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Develop and deploy using Hybrid Cloud Strategies confoo2012

  1. 1. Develop  &  deploy  using  hybrid  cloud  strategiesThijs  FerynEvangelist+32  (0)9  218  79  06thijs@combellgroup.com
  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/4951
  8. 8. What  is  Cloud?
  9. 9. “That’s  where  rain  comes  from” Andrei  Zmievski
  10. 10. Cloud =Internet
  11. 11. DefiniXon A  model  for  consumpXon  &   delivery  on  the  internet  where   flexibility  is  essenXal  &  can  be   guaranteed  through   abstracXon
  12. 12. Internet  as  a  uXlity
  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 ✓CompuXng ✓Database –EC2 –RDS –ELB –DynamoDB –Auto   –SimpleDB scaling –ElasXcache ✓Storage –SQS –S3 ✓CDN –EBS –CloudFront Self-­‐service  Iaas
  26. 26. Windows  Azure ✓CompuXng ✓Storage –Blob  storage –Table  storage ✓CDN ✓SQL  Azure ✓Data  sync ✓Service  Bus Self-­‐service  Paas
  27. 27. Orchestra ✓CompuXng ✓Database –Memcached –MySQL  &  RDS –CouchDB –MongoDB –Redis PHP  Paas  on  top  of  AWS
  28. 28. CombellFully  customized  &  managed  soluXons
  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. ReplicaXonR/W  splimng
  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 ✓AddiXonal  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  connecXonstring(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. MulXple  MySQL’s
  47. 47. MulXple  MySQL’s✓Developer –Read  write  splimng  in  code –Connect  to  loadbalanced  hostname✓Sysadmin –Setup  servers –Configure  replicaXon •Master/master •Master/slave –Add  to  loadbalancing
  48. 48. MulXple   Use  mysqlnd_ms  for  R/W  splimng  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"); ConnecXon   string
  50. 50. MulXple  MySQL’s What  ✓Amazon about  the   –MulXple  EC2  instances   Cloud? with  replicaXon  and  loadbalancing –RDS  with  read  replica✓Azure –Include  PHP  &  MySQL  in  package  script –Doesn’t  scale –Use  SQL  Azure✓Orchestra –RDS –Xeround
  51. 51. MulXple   web  servers
  52. 52. MulXple  web  servers✓Developer –MulXple  places  to  deploy –Where  are  my  staXc  assets? –Sessions?✓Sysadmin –MulXple  servers  behind  loadbalancer –$_SESSION  clustering  via  Memcached  or   sXcky  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. MulXple  Web  servers What  ✓Amazon about  the   –MulXple  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   staXc   files
  56. 56. Offload  staXc  files✓Developer –Sync  current  assets –Store  new  files  on  external  servers –Use  external  hostname  when  referencing   files✓Sysadmin –Tune  external  servers  for  staXc  content –CDN,  perhaps?
  57. 57. Offload  staXc  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  =  $storageClient-­‐>putBlob(testcontainer,  example.txt,  /example.txt);  echo  Blob  name  is:    .  $result-­‐>Name; Azure   Blog  storagerequire_once  Zend/Service/Amazon/S3.php;  $s3  =  new  Zend_Service_Amazon_S3($my_aws_key,  $my_aws_secret_key);  $s3-­‐>createBucket("my-­‐own-­‐bucket");  $s3-­‐>putObject("my-­‐own-­‐bucket/myobject",  "somedata");echo  $s3-­‐>getObject("my-­‐own-­‐bucket/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   opXons  in   file  system config  file
  68. 68. Design   pawerns Modular   e.g. AbstracXon   designDependency   injecXon layers
  69. 69. +  W3  Total   Cache
  70. 70. W3  Total  Cache✓Page  caching   -­‐ Memcached  (loadbalanced) -­‐ Varnish  (loadbalanced)✓Database  &  object  cache -­‐ Memcached  (loadbalanced)✓CDN -­‐ Push  to  S3  or  Azure  Blob  storage  buckets -­‐ Pull  from  CDN  (CloudFront  or  Azure) -­‐ 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. About  Azure  deployment
  74. 74. About  Azure  deploymentscaffolder  run  -­‐out="c:tempHelloAzureProject"package  create  -­‐in="C:tempHelloAzureProject"  -­‐out="C:tempHelloAzureDeployDev"  -­‐dev=true package   package   for  deployment and  run  on   emulatorpackage  create  -­‐in="C:tempHelloAzureProject"  -­‐out="C:tempHelloAzureDeployProduction"  -­‐dev=false
  75. 75. About  Azure  deployment Semngs.iniCertificate=XXXXXXXXSubscriptionId=XXXXXPassphrase=XXXXXXXXXStorageAccount=XXXXXPackageLocation=_filesPhpOnAzure.cspkgServiceConfigLocation=_filesServiceConfiguration.cscfg
  76. 76. About  Azure  deploymentdeployment.php  CreateFromLocal  -­‐-­‐ConfigFile="settings.ini"  -­‐-­‐Name="mysubdomain"  -­‐-­‐DeploymentName="testdeploy"  -­‐-­‐Label="testdeploy"  -­‐-­‐BySlot="staging"  -­‐-­‐StartImmediately  -­‐-­‐WaitFor Deploy   to  staging
  77. 77. About  Azure  deploymentdeployment.php  Swap  -­‐-­‐ConfigFile="settings.ini"  -­‐-­‐Name="mysubdomain"  -­‐-­‐WaitFor Scale   Swap   out to  producXondeployment.php  EditInstanceNumber  -­‐-­‐ConfigFile="settings.ini"  -­‐-­‐Name="subdomain"  -­‐-­‐ByName="testdeploy"  -­‐-­‐RoleName="PhpOnAzure.Web"  -­‐-­‐NewInstanceNumber=2
  78. 78. Mix  &  match
  79. 79. Management  models  (oAen  forgoBen)
  80. 80. Management  models  (oAen  forgoBen) Managed  Cloud  is  the   new  dedicated  server Unmanaged  Cloud  is   virtual  colocaXon
  81. 81. Management  models  (oAen  forgoBen) Custom  soluXon  at  hoster   under  heavy  SLA Burst  model  at  unmanaged   vendor
  82. 82. When  to  choose  what?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×