Transcript
Page 1: Php Azure, A bright new day! - PFCongres 2013

in it2

PHP  AzureA  brand  new  day

PFCongres Hét Web Development Congres

Page 2: Php Azure, A bright new day! - PFCongres 2013

in it2

email:  [email protected];er:  @dragonbefacebook:  dragonbe

ContactTrainer

Community  LeaderPHP  Consultant

Michelangelo  van  Dam

Page 3: Php Azure, A bright new day! - PFCongres 2013

in it2

#phpazure

Page 4: Php Azure, A bright new day! - PFCongres 2013

in it2

Why  Windows  Azure?‣ PHP  Developer‣ Write  web  applicaFons

‣ Want  to  deploy  fast  and  safe

‣ Prototyping

‣ Not  a  sysadmin‣ Don’t  have  Fme  to  worry  about  plaIorms

‣ Don’t  want  to  worry  about  scalability

Page 5: Php Azure, A bright new day! - PFCongres 2013

in it2

Azure  for  PHP  devs‣ Supports  most  common  PHP  frameworks‣ Symfony,  Zend  Framework,  Silex,  Slim,  …

‣ Building  robust  web  applicaFons‣ storage  and  CDN

‣ easy  separaFon  of  responsibiliFes

Page 6: Php Azure, A bright new day! - PFCongres 2013

in it2

Move  to  the  cloud

Page 7: Php Azure, A bright new day! - PFCongres 2013

in it2

Or  more  complexCentric Architecture

Web Application

Database

Queue

Storage

Cache

Proxy

Log

Mail

Page 8: Php Azure, A bright new day! - PFCongres 2013

in it2

Windows  Azure  StackCustom

Ready to go

Technology

Services

Data

Storage Blob Tables Queues CDN Cache

Page 9: Php Azure, A bright new day! - PFCongres 2013

in it2

Azure  SDK  for  PHP‣ Contents‣ PHP  client  libraries  for  Windows  Azure

‣ Command  line  tools  for  Mac  &  Linux

‣ Windows  Azure  powershell  for  Windows

‣ Windows  Azure  Emulators  for  Windows

Page 10: Php Azure, A bright new day! - PFCongres 2013

in it2

SDK  for  PHP‣ \WindowsAzure‣ \Blob

‣ \Common

‣ \Queue

‣ \ServiceBus

‣ \ServiceManagement

‣ \ServiceRunFme

‣ \Table

Page 11: Php Azure, A bright new day! - PFCongres 2013

in it2

Composer

$  svn  export  h:ps://github.com/WindowsAzure/azure-­‐sdk-­‐for-­‐php/trunk/WindowsAzure  library/WindowsAzure

Subversion  Hp

GITPEAR

SDK  installaFon

Page 12: Php Azure, A bright new day! - PFCongres 2013

in it2

PEAR  dependencies‣ HTTP_Request2

‣ Mail_mime

‣ Mail_mimeDecode

Page 13: Php Azure, A bright new day! - PFCongres 2013

in it2

Websites

Storage

Cloud  ServicesVirtual  Machines

Windows  Azure

CDN

SSLSLA

Mobile

Media Big  Data

QAVPN

IdenHtyMgmt

ACL

Page 14: Php Azure, A bright new day! - PFCongres 2013

in it2

Azure  Websites

Page 15: Php Azure, A bright new day! - PFCongres 2013

in it2

The  quickest  way  to  deploy  to  the  cloud

Page 16: Php Azure, A bright new day! - PFCongres 2013

in it2

Requirements‣ A  PHP  project

‣ A  version  control  system‣ local  (GIT,  Subversion,  TFS,  WebDeploy)

‣ on  line  (GitHub,  Bitbucket,  DropBox)

‣ AlternaFve  tools‣ FTP  deploy

‣ Using  VisualStudio  or  WebMatrix  to  deploy

‣ About  15  minutes

Page 17: Php Azure, A bright new day! - PFCongres 2013

in it2

One  important  thing!‣ DocumentRoot  in  project  subdir‣ e.g.  public/index.php

‣ Requirement  for  web.config

<rule name="GoPub" patternSyntax="Wildcard"> <match url="*" />    <action type="Rewrite" url="public/index.php" /></rule>

Page 18: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 19: Php Azure, A bright new day! - PFCongres 2013

in it2

Virtual  Machines

Page 20: Php Azure, A bright new day! - PFCongres 2013

in it2

AlternaFve  way  to  achieve  cloud  power

Page 21: Php Azure, A bright new day! - PFCongres 2013

in it2

Usages‣ Run  arbitrary  processes‣ e.g.  cron  processes

‣ Provide  uFlity  services‣ e.g.  forward  proxy

‣ Cloud  OS‣ Windows,  SQL  Server  or  Linux  in  the  cloud

Page 22: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 23: Php Azure, A bright new day! - PFCongres 2013

in it2

Cloud  Services

Page 24: Php Azure, A bright new day! - PFCongres 2013

in it2

I  was  clueless

? ? ?:-(

Page 25: Php Azure, A bright new day! - PFCongres 2013

in it2

Background‣ Coming  from  a  UNIX/Linux  environment‣ Worked  as  system  administrator

‣ Wrote  tools  in  Perl  (yeah,  I  know)

‣ Used  to  Cron,  Shell,  CGI  and  Daemons

‣ Worked  with  Windows  IIS‣ Never  had  to  set  things  up

‣ Used  FTP  to  deploy  on  the  system‣ Never  knew  the  fact  it  was  a  web  role  in  IIS

Page 26: Php Azure, A bright new day! - PFCongres 2013

in it2

Figuring  it  out‣ Web  Role‣ A  web  site  or  service  running  on  the  internet

‣ Can  use  all  Windows  Azure  services

‣ Worker  Role‣ Runs  processes  in  the  background

‣ Can  use  all  Windows  Azure  services

Page 27: Php Azure, A bright new day! - PFCongres 2013

in it2

Why  Cloud  Services?‣ All  the  power  of  Web  Sites

‣ With  smart  scaling  capabiliFes

‣ Memcache  like  caching  layer  per  instance

‣ Staging/ProducFon  environments‣ With  smart  swapping

‣ Allows  controlled  automated  deployments

Page 28: Php Azure, A bright new day! - PFCongres 2013

in it2

Command  line  tools

h;p://www.windowsazure.com/en-­‐us/manage/linux/how-­‐to-­‐guides/command-­‐line-­‐tools/h;p://msdn.microsok.com/en-­‐us/library/windowsazure/jj156055.aspx

Page 29: Php Azure, A bright new day! - PFCongres 2013

in it2

Endless  posibiliFes

WebApp WebApp WorkerApp

WinCache

Blob  Storage Table  Storage Queues

Azure  SQL 3rd-­‐party  MySQL

Page 30: Php Azure, A bright new day! - PFCongres 2013

in it2

DTAP  environment

Web  Fabric Staging ProducHon

WorkstaHon WindowsAzure

WindowsAzure

Page 31: Php Azure, A bright new day! - PFCongres 2013

in it2

Web  Role  for  PHP  Local‣ Start  Azure  Emulator‣ PS  C:\dev\myProject>  Start-­‐AzureEmulator

Creating local package...Starting Emulator...Role is running at http://127.0.0.1:81Started

Page 32: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 33: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 34: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 35: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 36: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 37: Php Azure, A bright new day! - PFCongres 2013

in it2

Page 38: Php Azure, A bright new day! - PFCongres 2013

in it2

Storage

Page 39: Php Azure, A bright new day! - PFCongres 2013

in it2

Blob  storage‣ Storage  for  binary  large  objects  (BLOB)‣ Block  blobs  (200GB)

‣ Page  blobs  (1TB)

‣ Unlimited  storage  capacity

‣ Content  delivery  network  (CDN)

‣ HTTP  and  HTTPS  support

‣ CNAME  support

‣ To  integrate  within  your  own  domain(e.g.  blob.mycompany.com)

‣ Data  replicaFon

Page 40: Php Azure, A bright new day! - PFCongres 2013

in it2

Blob  Storage  overview

My  Company

images

movies

image1.jpg

image2.jpg

movie1.mov

Page 41: Php Azure, A bright new day! - PFCongres 2013

in it2

Usage  of  blobs

https://mycompany.blob.core.windows.net/image/image1.jpghttps://cdn01.mycompany.com/image/image1.jpg

Page 42: Php Azure, A bright new day! - PFCongres 2013

in it2

Table  storage‣ Storage  of  structured  data‣ Oken  referred  to  as  NoSQL

‣ Implements  tree-­‐like  data  storage  and  retrieval

‣ Scalable  and  replicated

‣ Supports  OData  protocol

Page 43: Php Azure, A bright new day! - PFCongres 2013

in it2

Table  Storage  overview

Company

customer

product

name  =  …email  =  …

name  =  …email  =  …

code  =  …price  =  …

Page 45: Php Azure, A bright new day! - PFCongres 2013

in it2

Queue  Storage‣ FIFO  type  storage‣ Processing  one  item  a  Fme

‣ Messages  in  any  format  of  64KB

‣ Useful  for  deferred  acFons‣ Resize  of  images

‣ Sending  out  mails

‣ …

Page 46: Php Azure, A bright new day! - PFCongres 2013

in it2

Queue  Storage  overview

Email  2

Email  1

Email  3

WorkerRole

Email  1Queue Email  2

Page 48: Php Azure, A bright new day! - PFCongres 2013

in it2

Conclusion

Page 49: Php Azure, A bright new day! - PFCongres 2013

in it2

Conclusion‣ PHP  for  web  applicaFon  development

‣ WAWS  for  rapid  prototyping

‣ WACS  for  scaling  web  apps  and  workers

‣ WAVM  for  proxy,  tooling  and  scheduling

Page 50: Php Azure, A bright new day! - PFCongres 2013

in it2

PHP  checklist‣ Get  your  prototypes  online  quickly

‣ Ensure  your  apps  stay  online  all  the  Fme

‣ Distribute  responsibiliFes

‣ Integrate  3rd-­‐party  soluFons  easily

Page 51: Php Azure, A bright new day! - PFCongres 2013

in it2

No  system  knowledge  necessary!Limited

Page 52: Php Azure, A bright new day! - PFCongres 2013

in it2

Michelangelo  van  DamZend  CerFfied  Engineer

[email protected]

in it2

PHP  ConsulFng  -­‐  QA  Audits  -­‐  Training  Courses

www.in2it.be

Page 54: Php Azure, A bright new day! - PFCongres 2013

in it2

8957

If  you  liked  it,  thanks!If  not,  tell  me  how  to  improve

Page 55: Php Azure, A bright new day! - PFCongres 2013

in it2Thank  you


Recommended