SlideShare uma empresa Scribd logo
1 de 48
Bunch of user groups…  Kevin Schroeder Technology Evangelist Zend Technologies
About me Kevin Schroeder Technology Evangelist for Zend Programmer Sys Admin Author IBM i Programmer’s Guide to PHP You want to do WHAT with PHP?  Coming up Race Ferraris on the weekend My Honda has a dismal win record
I blog at eschrade.com Follow us! Zend Technologies http://twitter.com/zend http://twitter.com/kpschrade (me!)
A quick note on Zendcon… BE THERE!! ,[object Object]
Discover new advances
Gain new insights
Deploy and scale large PHP applications
Explore new technologies like NoSQL and Cloud Computing
Learn how to effectively leverage Zend Framework and Zend Framework 2.0,[object Object]
Why do we use PHP?
What does Zend do Zend Framework Zend Studio (8.0 in public beta 1) Zend Server Monitoring, Code tracing (freaking cool!!) Job queuing HA Session Clustering Zend Server Cluster Manager Does all of that in a clustered environment
Zend Server
Zend Server The primary reason to use Zend Server is insight What went wrong? Who did it happen to? What do I need to do to fix it?
Why do we need diagnostic tools?
Let’s slow that down a bit
There are several useful features in Zend Server 5
Deployment
Before we get going Who here is a developer? Who here is a system administrator? Who here has an existing deployment strategy? Who here has edited a file in production? Who here has wished they hadn’t?
Application Stages | 15 Increasing Maturity of PHP Applications Development Testing/QA Staging Production
Maturity | 16 Increasing Maturity of PHP Applications Uptime!! Testing & Validating Environment Testing & Validating Application Distinct Dev Environments Benefit Where are you? Structure
Application considerations Build the application to be aware of different environments Zend_Config_* is good at this Do not set the environment type in your code Environment variables can be placed in server config It means that you won’t accidentally keep your development settings turned on in production Make production your default environment Keeps accidental data leakage to a minimum bit.ly/phpDepApp
Deployment Option 1 – rsync Benefits Easy Already installed on your system Drawbacks No deployment script can be run Not integrated with either PHP or the OS Rollbacks require rolling back the entire source server Does not understand versioning  One option is to move the source tree prior to the rsync Uses xinetd bit.ly/phpDepRsync
Deployment Option 2 – Source Control Benefits  Easy  You should already be using source control  Has versioning  Can have pre/post install scripts  Easy to do automatic deployments  Drawbacks  Do you want to put details on how to access your source code on your production box?  Requires that your source control is accessible from production Deny access to .svn directories bit.ly/phpDepSVN
Deployment Option 3 – PEAR Benefits Designed for PHP Very scriptable Natural for doing things like clearing a cache Has a better understanding of PHP Cross  platform compatible Drawbacks Requires admins to be familiar with PHP code Limited to PHP deployment Available tooling is restrictive/build your own package.xml Define standardized locations (www, library, etc.) bit.ly/phpDepPEAR
Deployment Option 3 – PEAR Creating your PEAR Channel pear channel-discover pear.pirum-project.org  pear install pirum/Pirum-beta vi /var/www/pear/pirum.xml <server>  <name>qa/pear</name>  <summary>OurOrg PEAR channel</summary>  <alias>helloworld</alias>  <url>http://qa/pear/</url></server> php ./pirum build /var/www/pear/
Deployment Option 3 - PEAR Creating your PEAR package php ./build-pear.php pear package pirum add /var/www/pear/ HelloWorld-0.1.3.tgz
Deploying your app pear channel-discover qa/pear pear config-set www_dir /var/www pear install helloworld/HelloWorld pear clear-cache pear upgrade helloworld/HelloWorld Roll Back pear uninstall helloworld/HelloWorld pear install helloworld/HelloWorld-0.1.3
Deployment Option 4 - OS-based Benefits Easily added as part of your server deployment Very cloud friendly Admins already know how to use it Can describe OS-requirements/dependencies Downtime limited to actual install, not network transfer time Drawbacks Depends on environment Any PHP deployment scripting needs to be deployed with the application and executed in %post hook bit.ly/phpDepYum
Which should you use? Need something simple?  rsync Need to deploy to multiple disparate platforms? PEAR Need to deploy internally/with minimal developer input?OS (yum/apt) If using the OS consider maintaining an internal “blessed” repository instead of depending on the distribution
Which should you use? Need something simple?  rsync Need to deploy to multiple disparate platforms? PEAR Need to deploy internally/with minimal developer input?OS (yum/apt) If using the OS consider maintaining an internal “blessed” repository instead of depending on the distribution
Continuous Deployment Using automated deployment Very tight end-to-end integration Requires a lot of trust that the developers have a fully tested application w/ backend and frontend code Probably more work to manage if you can count the servers in your production environment with your fingers Could be beneficial but make sure you know what you’re doing You will need to have several testing experts Also… Look at what happened the last time we gave control to the machines It didn’t work out so well for the humans
Takeaways No need for copy-and-paste deployment No need for (S)FTP Have an easy rollback mechanism Prepare for errors in deployment Try to minimize the amount of scripting needed for deployment Consider using VMs on anything important to keep downtime to zero
Unit Testing
Unit Testing - partially stolen from Matthew Weier O’Phinney Why Unit Test? Simplify maintenance It defines expectations  It describes behaviors identified by the application  It tells us when new changes break existing code and behaviors
Terms Unit Test The piece of code you are testing Test A piece of code that calls the piece of code you’re testing Assertion Validating return types or results of the test Code Coverage A report on which lines of code have been tested Used to determine additional tests that need to be written Continuous Integration The continuous application of quality control, i.e. unit tests
Unit Testing – What to use PHP testing frameworks PHPT  Used by PHP, and some PEAR and independent libraries  SimpleTest JUnit-style testing framework  PHPUnit JUnit-style testing framework  De facto industry standard
Writing Unit Tests Create a test class  Create one or more methods describing behaviors  State the behaviors in natural language  Write code that creates the behavior(s)  Write code exercising the API  Write assertions indicating expectations
Examples Example 1 – Creating a Unit Test for a model in Zend Studio Example 2 – Creating a Unit Test based off of Code Coverage Example 3 – Testing a Zend Framework controller Using Zend_Test_PHPUnit_ControllerTestCase
Queuing/Scalable computing
Queuing/Scalable computing An interesting problem Nobody has built a fully scalable application
Typical anatomy of a PHP Application PHP: Past and Present Presentation Not so good for defining small bits/queuable functionality Application Control Database Access Business Logic Presentation Application Control Business Logic Presentation | 37
Options Use Cron Use Gearman Use home-grown (don’t do this) Use Zend Server Job Queue
Characteristics Allow for a sledgehammer to hit a machine Scalability and High Availability are yin and yang A site that can’t keep running is not scalable A site that can’t scale will fail (if it gets really popular)
Considerations Waste disk space Control usage (don’t let users do anything they want) Pre-calculate as much as possible Calculate and cache/store Don’t scan large amounts of data Keep data processing off the front end servers Don’t just cache Don’t let it substitute for thought Cache hit rates can be meaningless if you have hundreds of cache hits for a request
Considerations ,[object Object],Decouple/Partition Don’t tie everything into the database Use queues/messaging Stomp interfaces are really good for PHP
The Golden Rule of Scalability “It can probably wait”
When do you not need current data Credit card processing? Request for the front page? Sign in? Viewing a shopping cart? Displaying a page with ads? Answer? Almost always Data is “out of date” once it leaves the web server
What could this look like?

Mais conteúdo relacionado

Mais procurados

Automated Testing Overview
Automated Testing OverviewAutomated Testing Overview
Automated Testing Overview
antsh
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 

Mais procurados (19)

Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
 
Why do so many companies ...
Why do so many companies ...Why do so many companies ...
Why do so many companies ...
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, Ukraine
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
Beyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms OrganizationsBeyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms Organizations
 
Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013Rspec and Capybara Intro Tutorial at RailsConf 2013
Rspec and Capybara Intro Tutorial at RailsConf 2013
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to Titanium
 
Automated Testing Overview
Automated Testing OverviewAutomated Testing Overview
Automated Testing Overview
 
Selenium
SeleniumSelenium
Selenium
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Automate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaSAutomate across Platform, OS, Technologies with TaaS
Automate across Platform, OS, Technologies with TaaS
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | EdurekaSelenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
 
Practical Tips & Tricks for Selenium Test Automation
Practical Tips & Tricks for Selenium Test AutomationPractical Tips & Tricks for Selenium Test Automation
Practical Tips & Tricks for Selenium Test Automation
 
Automated Exploratory Testing
Automated Exploratory TestingAutomated Exploratory Testing
Automated Exploratory Testing
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automation
 

Semelhante a Slides from LAX & DEN usergroup meetings (20)

North east user group tour
North east user group tourNorth east user group tour
North east user group tour
 
Lamp Zend Security
Lamp Zend SecurityLamp Zend Security
Lamp Zend Security
 
Demo
DemoDemo
Demo
 
first pitch
first pitchfirst pitch
first pitch
 
werwr
werwrwerwr
werwr
 
sdfsdf
sdfsdfsdfsdf
sdfsdf
 
college
collegecollege
college
 
first pitch
first pitchfirst pitch
first pitch
 
Greenathan
GreenathanGreenathan
Greenathan
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
first pitch
first pitchfirst pitch
first pitch
 
organic
organicorganic
organic
 
first pitch
first pitchfirst pitch
first pitch
 
latest slide
latest slidelatest slide
latest slide
 
345
345345
345
 
before upload
before uploadbefore upload
before upload
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
werwer
werwerwerwer
werwer
 
before upload
before uploadbefore upload
before upload
 
latest slide
latest slidelatest slide
latest slide
 

Mais de 10n Software, LLC

Delaying Gratification: Using queues to build efficient systems
Delaying Gratification: Using queues to build efficient systemsDelaying Gratification: Using queues to build efficient systems
Delaying Gratification: Using queues to build efficient systems
10n Software, LLC
 
Flex and PHP For the Flash Folks
Flex and PHP For the Flash FolksFlex and PHP For the Flash Folks
Flex and PHP For the Flash Folks
10n Software, LLC
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools
10n Software, LLC
 
Application Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 betaApplication Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 beta
10n Software, LLC
 
Creating stunning data analytics dashboard using php and flex
Creating stunning data analytics dashboard using php and flexCreating stunning data analytics dashboard using php and flex
Creating stunning data analytics dashboard using php and flex
10n Software, LLC
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue
10n Software, LLC
 

Mais de 10n Software, LLC (14)

Delaying Gratification: Using queues to build efficient systems
Delaying Gratification: Using queues to build efficient systemsDelaying Gratification: Using queues to build efficient systems
Delaying Gratification: Using queues to build efficient systems
 
10 things
10 things10 things
10 things
 
Flex and PHP For the Flash Folks
Flex and PHP For the Flash FolksFlex and PHP For the Flash Folks
Flex and PHP For the Flash Folks
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools
 
Application Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 betaApplication Deployment with Zend Server 5.5 beta
Application Deployment with Zend Server 5.5 beta
 
Do you queue (updated)
Do you queue (updated)Do you queue (updated)
Do you queue (updated)
 
Flex for php developers
Flex for php developersFlex for php developers
Flex for php developers
 
Creating stunning data analytics dashboard using php and flex
Creating stunning data analytics dashboard using php and flexCreating stunning data analytics dashboard using php and flex
Creating stunning data analytics dashboard using php and flex
 
Php security common 2011
Php security common 2011Php security common 2011
Php security common 2011
 
Slideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You QueueSlideshare - Magento Imagine - Do You Queue
Slideshare - Magento Imagine - Do You Queue
 
Do you queue
Do you queueDo you queue
Do you queue
 
Zend Server - OSI Days
Zend Server - OSI DaysZend Server - OSI Days
Zend Server - OSI Days
 
Zend Framework Workshop
Zend Framework WorkshopZend Framework Workshop
Zend Framework Workshop
 
Flex and Zend Framework
Flex and Zend FrameworkFlex and Zend Framework
Flex and Zend Framework
 

Último

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Slides from LAX & DEN usergroup meetings

  • 1. Bunch of user groups…  Kevin Schroeder Technology Evangelist Zend Technologies
  • 2. About me Kevin Schroeder Technology Evangelist for Zend Programmer Sys Admin Author IBM i Programmer’s Guide to PHP You want to do WHAT with PHP? Coming up Race Ferraris on the weekend My Honda has a dismal win record
  • 3. I blog at eschrade.com Follow us! Zend Technologies http://twitter.com/zend http://twitter.com/kpschrade (me!)
  • 4.
  • 7. Deploy and scale large PHP applications
  • 8. Explore new technologies like NoSQL and Cloud Computing
  • 9.
  • 10. Why do we use PHP?
  • 11. What does Zend do Zend Framework Zend Studio (8.0 in public beta 1) Zend Server Monitoring, Code tracing (freaking cool!!) Job queuing HA Session Clustering Zend Server Cluster Manager Does all of that in a clustered environment
  • 13. Zend Server The primary reason to use Zend Server is insight What went wrong? Who did it happen to? What do I need to do to fix it?
  • 14. Why do we need diagnostic tools?
  • 15. Let’s slow that down a bit
  • 16. There are several useful features in Zend Server 5
  • 18. Before we get going Who here is a developer? Who here is a system administrator? Who here has an existing deployment strategy? Who here has edited a file in production? Who here has wished they hadn’t?
  • 19. Application Stages | 15 Increasing Maturity of PHP Applications Development Testing/QA Staging Production
  • 20. Maturity | 16 Increasing Maturity of PHP Applications Uptime!! Testing & Validating Environment Testing & Validating Application Distinct Dev Environments Benefit Where are you? Structure
  • 21. Application considerations Build the application to be aware of different environments Zend_Config_* is good at this Do not set the environment type in your code Environment variables can be placed in server config It means that you won’t accidentally keep your development settings turned on in production Make production your default environment Keeps accidental data leakage to a minimum bit.ly/phpDepApp
  • 22. Deployment Option 1 – rsync Benefits Easy Already installed on your system Drawbacks No deployment script can be run Not integrated with either PHP or the OS Rollbacks require rolling back the entire source server Does not understand versioning One option is to move the source tree prior to the rsync Uses xinetd bit.ly/phpDepRsync
  • 23. Deployment Option 2 – Source Control Benefits Easy You should already be using source control Has versioning Can have pre/post install scripts Easy to do automatic deployments Drawbacks Do you want to put details on how to access your source code on your production box? Requires that your source control is accessible from production Deny access to .svn directories bit.ly/phpDepSVN
  • 24. Deployment Option 3 – PEAR Benefits Designed for PHP Very scriptable Natural for doing things like clearing a cache Has a better understanding of PHP Cross platform compatible Drawbacks Requires admins to be familiar with PHP code Limited to PHP deployment Available tooling is restrictive/build your own package.xml Define standardized locations (www, library, etc.) bit.ly/phpDepPEAR
  • 25. Deployment Option 3 – PEAR Creating your PEAR Channel pear channel-discover pear.pirum-project.org pear install pirum/Pirum-beta vi /var/www/pear/pirum.xml <server>  <name>qa/pear</name>  <summary>OurOrg PEAR channel</summary>  <alias>helloworld</alias>  <url>http://qa/pear/</url></server> php ./pirum build /var/www/pear/
  • 26. Deployment Option 3 - PEAR Creating your PEAR package php ./build-pear.php pear package pirum add /var/www/pear/ HelloWorld-0.1.3.tgz
  • 27. Deploying your app pear channel-discover qa/pear pear config-set www_dir /var/www pear install helloworld/HelloWorld pear clear-cache pear upgrade helloworld/HelloWorld Roll Back pear uninstall helloworld/HelloWorld pear install helloworld/HelloWorld-0.1.3
  • 28. Deployment Option 4 - OS-based Benefits Easily added as part of your server deployment Very cloud friendly Admins already know how to use it Can describe OS-requirements/dependencies Downtime limited to actual install, not network transfer time Drawbacks Depends on environment Any PHP deployment scripting needs to be deployed with the application and executed in %post hook bit.ly/phpDepYum
  • 29. Which should you use? Need something simple? rsync Need to deploy to multiple disparate platforms? PEAR Need to deploy internally/with minimal developer input?OS (yum/apt) If using the OS consider maintaining an internal “blessed” repository instead of depending on the distribution
  • 30. Which should you use? Need something simple? rsync Need to deploy to multiple disparate platforms? PEAR Need to deploy internally/with minimal developer input?OS (yum/apt) If using the OS consider maintaining an internal “blessed” repository instead of depending on the distribution
  • 31. Continuous Deployment Using automated deployment Very tight end-to-end integration Requires a lot of trust that the developers have a fully tested application w/ backend and frontend code Probably more work to manage if you can count the servers in your production environment with your fingers Could be beneficial but make sure you know what you’re doing You will need to have several testing experts Also… Look at what happened the last time we gave control to the machines It didn’t work out so well for the humans
  • 32. Takeaways No need for copy-and-paste deployment No need for (S)FTP Have an easy rollback mechanism Prepare for errors in deployment Try to minimize the amount of scripting needed for deployment Consider using VMs on anything important to keep downtime to zero
  • 34. Unit Testing - partially stolen from Matthew Weier O’Phinney Why Unit Test? Simplify maintenance It defines expectations It describes behaviors identified by the application It tells us when new changes break existing code and behaviors
  • 35. Terms Unit Test The piece of code you are testing Test A piece of code that calls the piece of code you’re testing Assertion Validating return types or results of the test Code Coverage A report on which lines of code have been tested Used to determine additional tests that need to be written Continuous Integration The continuous application of quality control, i.e. unit tests
  • 36. Unit Testing – What to use PHP testing frameworks PHPT Used by PHP, and some PEAR and independent libraries SimpleTest JUnit-style testing framework PHPUnit JUnit-style testing framework De facto industry standard
  • 37. Writing Unit Tests Create a test class Create one or more methods describing behaviors State the behaviors in natural language Write code that creates the behavior(s) Write code exercising the API Write assertions indicating expectations
  • 38. Examples Example 1 – Creating a Unit Test for a model in Zend Studio Example 2 – Creating a Unit Test based off of Code Coverage Example 3 – Testing a Zend Framework controller Using Zend_Test_PHPUnit_ControllerTestCase
  • 40. Queuing/Scalable computing An interesting problem Nobody has built a fully scalable application
  • 41. Typical anatomy of a PHP Application PHP: Past and Present Presentation Not so good for defining small bits/queuable functionality Application Control Database Access Business Logic Presentation Application Control Business Logic Presentation | 37
  • 42. Options Use Cron Use Gearman Use home-grown (don’t do this) Use Zend Server Job Queue
  • 43. Characteristics Allow for a sledgehammer to hit a machine Scalability and High Availability are yin and yang A site that can’t keep running is not scalable A site that can’t scale will fail (if it gets really popular)
  • 44. Considerations Waste disk space Control usage (don’t let users do anything they want) Pre-calculate as much as possible Calculate and cache/store Don’t scan large amounts of data Keep data processing off the front end servers Don’t just cache Don’t let it substitute for thought Cache hit rates can be meaningless if you have hundreds of cache hits for a request
  • 45.
  • 46. The Golden Rule of Scalability “It can probably wait”
  • 47. When do you not need current data Credit card processing? Request for the front page? Sign in? Viewing a shopping cart? Displaying a page with ads? Answer? Almost always Data is “out of date” once it leaves the web server
  • 48. What could this look like?
  • 49. Let’s write some code (if we have time) (no I’m not copping out. We’re all told to show our work in grade scool)
  • 50. Follow us! Zend Technologies http://twitter.com/zend http://twitter.com/kpschrade (me!)
  • 51. Get this information and all the examples at eschrade.com…
  • 52.
  • 55. Deploy and scale large PHP applications
  • 56. Explore new technologies like NoSQL and Cloud Computing
  • 57. Learn how to effectively leverage Zend Framework and Zend Framework 2.0