Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Developing PHP Applications Faster

Enterprise PHP development teams, no matter the maturity level, focus on one thing, releasing stable apps that perform. They also want to avoid reinventing the wheel. Therefore, make the investment to listen to the top lessons we've learned from across industries to deliver PHP code faster without sacrificing quality, user experience, or existing workflows.

You will learn:

How to dig deep into application behavior and performance at runtime
How to maximize existing continuous delivery principles and tools
When to take advantage of existing frameworks and extensions and when to do it yourself
How to avoid reinventing the wheel each time you deploy, upgrade, or rollback

  • Soyez le premier à commenter

Developing PHP Applications Faster

  1. 1. Building the perfect PHP app for the enterprise Developing apps faster Adam Culp @adamculp
  2. 2. Adam Culp @adamculp Senior Professional Services Consultant Rogue Wave Software
  3. 3. 3 Enterprise PHP is mission-critical • Built securely • Delivers optimal performance + scale • Always on • Meets release timelines • Modernizes legacy business logic • Clear support path (production + LTS)
  4. 4. 4 Deployment automation is key • Amazon – 1 deployments/second - Werner Vogels. CTO Amazon • Etsy – 40 – 50 deployments/day • Netflix – highly automated deployments and testing (Simian Army) techblog.netflix.com/2016/03/how-we-build-code-at-netflix.html
  5. 5. Poll #1
  6. 6. 6 Poll #1 related DevOps responses • DevOps maturity assessment poll • Satisfied with deployment process – 62% somewhat satisfied – 40% dissatisfied
  7. 7. 7 Faster deployment cycles Faster development=
  8. 8. 8 Benefits • Faster feedback from end users • Faster feature requirements • More iterations • Less waste (time, code) • Better product overall Faster deployment cycles Faster development=
  9. 9. 9 The traditional waterfall approach Requirements Design Implementation Verification Maintenance
  10. 10. 10 “WaterGile” anyone? • Teams within an organization subscribing to Agile methodology • Teams often isolated – entire company didn’t buy into Agile methodologies • Still gather requirements, development broken down into iterations to build according to user stories
  11. 11. Poll #2
  12. 12. 12 Poll #2 related Tech Beacon responses • Deployment practice (600 devs) – 65% pure Agile – 9% Waterfall
  13. 13. 13 Result of not iterating fast • Technical debt increases • Always in catchup • “Nice to have” items forgotten
  14. 14. 14 Faster deployment cycles Faster development=
  15. 15. Feedback loop and monitoring
  16. 16. 16 Typical release (many features to all) Add a map displaying available cars to rent within 10 km radius Released to all Impact? Which new feature caused it? PANIC! Overload – servers down, root cause unknown
  17. 17. 17 Release single feature to some users Add a map displaying available cars to rent within 10 km radius Release to 20% of users Compare with 80% Change in a query, or amount of data returned Fix or turn of Overloaded CPU – some servers down
  18. 18. 18 Tools to use • Instrument your code – PHP feature toggle (qandidate-toggle) – release to a subset of users • Zend Server Monitoring – complete solution to monitor behavior an application – will catches the 20% spike in CPU usage quickly and easily
  19. 19. 19 It’s working… ramp it up! 10% more rentals per visitor on version with map Little to no change in performance Release to everyone Add a map displaying available cars to rent within 10 km radius Release to 50% more users
  20. 20. Demo #1 Monitoring System
  21. 21. Release automation
  22. 22. 22 Worked fine in development • Environment consistency
  23. 23. 23 Develop map feature Package Packaged app (parametrized) Staging TEST Prod Commit Rollback Consistency
  24. 24. 24 Tools that can help • Dependency Management – Composer (json, lock) – Packagist (public, private) • VMs and consistency – Vagrant – Docker – Others… • Deployment – Zend Server (deployment) – AWS code deploy – Others…
  25. 25. Continuous integration
  26. 26. 26 What is it? • CI automates: – Building – Packaging – Testing – Deploying • If build breaks, developer who broke it fixes it • If build passes, it’s production ready
  27. 27. 27 Typical CI pipeline Git clone Composer install Unit test Static Analysis Deploy to test Functional test Deploy to Staging Deploy to prod Add a map displaying available cars to rent within 10 km radius Package
  28. 28. 28 Failure! Git clone Composer install Unit test FAIL Build n failed Add a map displaying available cars to rent within 10 km radius
  29. 29. 29 Tools that can help Many Others…
  30. 30. Poll #3
  31. 31. 31 Poll #3 related DevOps responses • DevOps maturity assessment poll used practices – 76% code deployment – 62% Continuous Integration – 31% automation and provisioning
  32. 32. Demo #2 CI Server
  33. 33. Testing automation
  34. 34. 34 Testing at different stages • Unit testing • Functional testing • Integration testing (regression) • Load testing
  35. 35. 35 Cost of bug fixing Stefan Priebsh – Advanced OOP and design patterns Credit: Stefan Priebsh thePHP.cc
  36. 36. 36 Test early, test often! Takeaway
  37. 37. 37 Simulate a browser request and ensure that a map loads, and that the map has the number of vehicles available for rent Functiona l getCars($criteria, $radius) $map->plotCoordinates($cars) $modelView->assign(‘map’, $map) Unit Load 1,000 concurrent search requests for cars from 1000 different locations Load Testing Steps Add a map displaying available cars to rent within 10 km radius
  38. 38. Poll #4
  39. 39. 39 Poll #4 typical related responses • Do you unit test? – 65% Yes – 36% No
  40. 40. 40 Tools that can help • ab, Jmeter, LoadRunner (performance and load testing) • PHPUnit (unit testing) • Behat – Mink (behavioral) • PHPspec (unit testing)
  41. 41. Frameworks/libraries
  42. 42. Poll #5
  43. 43. 43 Poll #5 related DevOps responses • DevOps maturity survey poll – What simplified software development the most in past year – 35% some type of framework
  44. 44. 44 Evolution of frameworks • MVC full functionality – All or nothing • Component frameworks – No lock-in – Choose your stack • MVC out, middleware in • Microservice architecture
  45. 45. 45 Tools that can help So many… • Zend Framework: ZF3, Expressive, Apigility • Laravel, Symfony, Slim, and many more
  46. 46. Writing code and left shifting
  47. 47. 47 Catch bugs early • Remember how a bug in prod can cost as much as 15X times the cost of a bug in development?
  48. 48. 48 How do you catch bugs early? • Test early, test often – during development, local before commit • Static Analysis • Peer reviews • Code instrumentation tools
  49. 49. Demo Toolbars
  50. 50. What about hardware and infrastructure?
  51. 51. 51 Infrastructure should also be automated • Automate server provisioning – Chef, Puppet, Ansible, Salt, others… • Version environment build configs • Goal = fully rebuild environment automatically on fail
  52. 52. 52 Another example – dealnews.com • In the past 2 weeks – Deployed web application 64 times – average 6.5 times a day – Deployed configuration management changes 12 times – Deployed MySQL schema changes 13 times - Courtesy of Brian Moon
  53. 53. Future?
  54. 54. 54 What it may look like • Container-ize all the things – No longer push code to servers – Push new servers containing code/application • Environment templates – Traditional hardware or VM – Provision with new code, destroy old when users moved – Netflix does their interpretation of this
  55. 55. Q&A
  56. 56. Building the perfect PHP app for the enterprise Developing apps faster Adam Culp @adamculp

×