PHP – Faster And Cheaper. Scale Vertically with IBM i


Published on

The only way to scale your PHP application is horizontally? If you believe that then you could be missing a huge opportunity. This talk will layout why scaling vertically with the Power System platform can be a superior alternative to a traditional LAMP stack. With simplify development, reduce operation costs and a true enterprise quality database

Published in: Technology
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • How your development philosophy and the platform you pick will effect your application design
  • Simplicity of implementation over simplicity of interface Better to be simple than 100% correct Be consistent, but not at the expense of simplicity Cover all major cases, but completeness is the least important attribute Made developer do more work Make people wait for less important feature
  • Becomes a virus Lower user expectations
  • Becomes a virus Lower user expectations
  • As a business Twitter are missing a lot. 3rd party clients improved on the website. -Allowed them to focus on infrastructure and saved them money Most new features have come from the community -hash tags [email_address] -ReTweet
  • Pick a platform that allows you to remove complexity. Things to consider when picking your platform
  • Try to avoid them as much a possible
  • Official Indianapolis 500 site
  • Application logic for where reads go and where writes go Plus fail over
  • Hard problems are fun to solve
  • In it’s purest form
  • Spend more time on business work
  • Simplification is the key
  • PCI compliance
  • Auto index creation and management
  • Use as little as 1/100th of a core. The project that you don’t want in the data center
  • Red tape is killing agility
  • PHP – Faster And Cheaper. Scale Vertically with IBM i

    1. 1. PHP – Faster And Cheaper. Scale Vertically with IBM i on Power Systems By Sam Hennessy – Zend Professional Services Consultant
    2. 2. General Rules and Edge Cases <ul><li>As a general rule, I’d recommend horizontal scaling </li></ul><ul><li>There are cases where vertical scaling fits better </li></ul>
    3. 3. Application Design <ul><li>“ Simplicity, carried to the extreme, becomes elegance.” </li></ul><ul><li>Jon Franklin (Pulitzer Prize Winner) </li></ul>
    4. 4. Worse is Better by Richard Gabriel Better to get it out now with 50% to 80% of functionality, than later with 90%.
    5. 5. Worse is Better <ul><li>Examples from Richard are Unix and C </li></ul><ul><ul><li>“ Early Unix and C compilers … require[d] few machine resources to run, and provide about 50% to 80% of what you want.” </li></ul></ul><ul><ul><li>“ Unix and C are the ultimate computer viruses.” </li></ul></ul><ul><ul><li>“ Once the virus has spread, there will be pressure to improve it…” </li></ul></ul>
    6. 6. Worse is Better <ul><li>80-20 Rule </li></ul><ul><ul><li>20% of the effort yields 80% of the value </li></ul></ul><ul><ul><li>A 20% complete product, has 80% of what the users want </li></ul></ul>“ The first 90% of the code accounts for the first 90% of the development time.  The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill (C++ Pioneer)
    7. 7. Worse is Better <ul><li>Another example is Twitter. </li></ul><ul><ul><li>Started with a good API, but a limited website. </li></ul></ul><ul><ul><ul><li>20% of the work? </li></ul></ul></ul>
    8. 8. Platform Choice “ An underappreciated advantage of a platform approach is junior developers can quickly and confidently create robust applications on top of the platform. If every project needs to create the same distributed infrastructure wheel you’ll run into difficulty because the people who know how to do this are relatively rare.” – A quote referring to Google
    9. 9. Debugging Is Hard <ul><li>Many layers of abstraction </li></ul><ul><li>Remote application calls </li></ul><ul><li>Asynchronous processing and message busses </li></ul>“ Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan (Unix Pioneer and Creator of cron)
    10. 10. Scalability <ul><li>“ It’s hardware that makes a machine fast.  It’s software that makes a fast machine slow.” </li></ul><ul><li>Craig Bruce </li></ul>
    11. 11. Scalability - Planning <ul><li>How much do you need to scale to? </li></ul><ul><ul><li>Internal company application </li></ul></ul><ul><ul><li>Shopping cart </li></ul></ul><ul><ul><li>Twitter </li></ul></ul><ul><ul><li>Facebook </li></ul></ul><ul><ul><li>Google search </li></ul></ul><ul><li>Capacity planning is difficult for new applications </li></ul>
    12. 12. Horizontal Scalability (Scale Out)
    13. 13. Horizontal Scalability <ul><li>Solution = Use lots of cheap PCs and spread the work around </li></ul><ul><ul><li>Small upfront investment in hardware </li></ul></ul><ul><ul><li>Growth costs are fine grained </li></ul></ul><ul><ul><li>Well established solution to growth </li></ul></ul>Generally, an individual web request only needs a small amount of computing resources.
    14. 14. Horizontal Scalability Web Server Database
    15. 15. Reads Master Writes Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    16. 16. Reads Master Writes Slave Slave Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    17. 17. Reads Master Writes Slave Slave Chat Blogs Chat Reads Chat Writes Blog Reads Blog Writes Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    18. 18. Slave Slave Reads Master Slave Slave Chat Blogs Chat Reads Slave Slave Blog Reads Chat Writes Blog Writes Writes Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    19. 19. Chat 1 Read Write Chat 2 Chat 3 Chat 5 Chat 6 Chat 4 Chat 7 Chat 8 Chat 9 Chat 10 Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    20. 20. Chat 1 Read Chat 2 Chat 3 Chat 5 Chat 6 Chat 4 Chat 7 Chat 8 Chat 9 Chat 10 Write Key Lookup Shard Keys Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    21. 21. Chat 1 Read Chat 2 Chat 3 Chat 5 Chat 6 Chat 4 Chat 7 Chat 8 Chat 9 Chat 10 Write Key Lookup Shard Keys Chat 1 Chat 2 Chat 3 Chat 5 Chat 6 Chat 4 Chat 7 Chat 8 Chat 9 Chat 10 Shard Keys Web Server Web Server Web Server Web Server Web Server Web Server Web Server
    22. 22. Horizontal Scaling – Issues With Sharding <ul><li>No cross-shard SQL queries </li></ul><ul><li>No foreign keys, auto_increment’s or transactions </li></ul><ul><li>Balancing shards </li></ul><ul><ul><li>Power users </li></ul></ul><ul><ul><li>Rebalancing after adding more shards </li></ul></ul>
    23. 23. Horizontal Scaling – Issues With Sharding <ul><li>Networking overheads </li></ul><ul><li>Backups </li></ul>“ This means you have to deal with enforcing integrity on the application level, and you might eventually end up spending a significant amount of your development time on check and fix routines.” - Jurriaan Persyn (Netlog)
    24. 24. Horizontal Scaling <ul><li>Why? </li></ul><ul><ul><li>Simply put, too much complexity </li></ul></ul>“ You don’t want to shard. Optimize everything else first, and then if performance still isn’t good enough, it’s time to take a  very  bitter medicine.” - Morgan Tocker (MySQL Performance Blog)
    25. 25. Horizontal Scaling <ul><li>Peter Says: </li></ul><ul><ul><li>In most cases he advises against: </li></ul></ul><ul><ul><ul><li>Reading from the slaves </li></ul></ul></ul><ul><ul><ul><li>Sharding   </li></ul></ul></ul><ul><ul><ul><li>Complex replication </li></ul></ul></ul><ul><ul><ul><li>Complex high availability designs </li></ul></ul></ul>“ the recipes from Facebook, YouTube, Yahoo, are not good for like 99.9% of the applications” “ this “smart thing” was [it] truly thought out architecture choice in [the] beginning or it was the choice within code base constrain[t]s” - Peter Zaitsev (MySQL Performance Blog)
    26. 26. Horizontal Scaling - Downsides <ul><li>Large upfront investment in design, planning and development to allow for horizontal scaling </li></ul><ul><li>Difficult to respond to very fast growth </li></ul><ul><li>More physical servers also means more: </li></ul><ul><ul><li>datacenter space </li></ul></ul><ul><ul><li>networking hardware </li></ul></ul><ul><ul><li>people </li></ul></ul><ul><ul><li>software licenses? </li></ul></ul>
    27. 27. Horizontal Scaling – Comfort Zone <ul><li>Why is horizontal scaling so prevalent? </li></ul><ul><ul><li>It’s been proven to work </li></ul></ul><ul><ul><li>Lots of literature on it </li></ul></ul>“ Better the devil you know than the devil you don't know” - Proverb
    28. 28. Vertical Scalability (Scale Up) <ul><li>A superior pilot uses his superior judgment to avoid having to exercise his superior skill. </li></ul><ul><li>Pilot’s Maxim </li></ul>
    29. 29. Vertical Scaling <ul><li>The original scaling methodology </li></ul><ul><li>One server does everything </li></ul>
    30. 30. Vertical Scaling – Application Impact <ul><li>Simpler applications means: </li></ul><ul><ul><li>Easier to design </li></ul></ul><ul><ul><li>Easier to plan </li></ul></ul><ul><ul><li>Lower development time </li></ul></ul><ul><ul><li>Easier to debug and test </li></ul></ul>No scalability “features” = Simpler application!
    31. 31. Web Server Database
    32. 32. Web Server (Dev / QA / Stage / Production) Database (Dev / QA / Stage / Production) SVN / CI / Ticket System / WIKI
    33. 33. Why IBM Power Systems? <ul><li>Completely different mindset from Linux and x86 </li></ul><ul><li>Self Managing, Self Repairing </li></ul>Less a scaled up x86 Server, more a scaled down Mainframe.
    34. 34. Why IBM i? <ul><li>“ Turnkey” </li></ul><ul><li>Requires little attention from IT </li></ul><ul><li>PHP, MySQL and Apache run natively </li></ul><ul><li>DB2 database is built in </li></ul>
    35. 35. IBM Power Systems Upgrade Path <ul><li>Full binary compatibility </li></ul><ul><li>With servers up to: </li></ul><ul><ul><li>64 5.0GHz Cores </li></ul></ul><ul><ul><li>4TB of RAM </li></ul></ul><ul><ul><li>381 TB HDD (32 I/O Draws) </li></ul></ul><ul><li>Capacity On Demand </li></ul>
    36. 36. Availability <ul><li>“ Never trust a computer you can’t throw out a window.” </li></ul><ul><li>Steve Wozniak ( Apple Computer, Inc. Co-Founder) </li></ul>
    37. 37. Availability <ul><li>Power Systems availability rating is over 99.9% </li></ul><ul><li>Google Apps also guarantees availability for 99.9% </li></ul>99.9% 8.76 hours downtime
    38. 38. PHP on IBM i <ul><li>“ Simplicity is the ultimate sophistication.” </li></ul><ul><li>  Leonardo da Vinci  </li></ul>
    39. 39. PHP on IBM i <ul><li>Zend Core for i5/OS </li></ul><ul><ul><li>Runs natively </li></ul></ul><ul><ul><li>Ships with IBM i </li></ul></ul><ul><ul><li>1 year of Zend Silver Level support included </li></ul></ul><ul><ul><li>“ IBM i Toolkit” </li></ul></ul>
    40. 40. PHP on IBM i <ul><li>Zend Studio for i5/OS </li></ul><ul><ul><li>Included in price of IBM i (a.k.a. free) </li></ul></ul><ul><ul><li>Debugging integration for the IBM i </li></ul></ul><ul><ul><li>Supports the IBM i Toolkit </li></ul></ul><ul><ul><li>Best PHP IDE on the market </li></ul></ul>
    41. 41. PHP on IBM i <ul><li>Zend Platform for i5/OS </li></ul><ul><ul><li>Real-time Monitoring (PHP Intelligence) </li></ul></ul><ul><ul><li>Op-code cache (Code Acceleration) </li></ul></ul><ul><ul><li>Java integration (Java Bridge) </li></ul></ul><ul><ul><li>Rule base output caching (Full page caching) </li></ul></ul><ul><ul><li>Data caching (Partial page caching) </li></ul></ul><ul><ul><li>Zend Download Server </li></ul></ul>
    42. 42. PHP on IBM i <ul><li>Zend Server 5 </li></ul><ul><ul><li>Beta coming soon </li></ul></ul><ul><ul><li>More performance </li></ul></ul><ul><ul><li>Code tracing </li></ul></ul>
    43. 43. Databases <ul><li>“ Controlling complexity is the essence of computer programming.” </li></ul><ul><li>- Brian Kernigan (Unix Pioneer and Creator of cron) </li></ul>
    44. 44. Databases <ul><li>MySQL </li></ul><ul><ul><li>Runs natively on IBM i </li></ul></ul><ul><ul><li>Officially supported by MySQL AB </li></ul></ul><ul><ul><li>DB2 Storage Engine for MySQL </li></ul></ul>
    45. 45. Databases <ul><li>DB2 </li></ul><ul><ul><li>Mainframe quality database </li></ul></ul><ul><ul><li>Integrated into the IBM i operating system </li></ul></ul><ul><ul><li>Low maintenance </li></ul></ul><ul><ul><li>An IBM i Admin will also be your DB2 DBA </li></ul></ul>
    46. 46. Operations <ul><li>“ Complexity kills.  It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration.” </li></ul><ul><li>Ray Ozzie (Chief Software Architect at Microsoft) </li></ul>
    47. 47. Consolidation <ul><li>Hard VMs not Soft VMs </li></ul><ul><ul><li>Firmware based </li></ul></ul><ul><ul><li>Hardware and OS is VM aware </li></ul></ul><ul><ul><li>Dynamic Logical Partitioning </li></ul></ul><ul><ul><ul><li>Processor, memory, and I/O resources </li></ul></ul></ul>Most servers are only using 10% to 20% of there capacity
    48. 48. Costs – IBM Power System Rule of Thumb <ul><li>Total Cost of Acquisition (TCA) is higher </li></ul><ul><li>Total Cost of Ownership (TCO) is lower </li></ul>
    49. 49. Costs – What Are The Costs? <ul><li>Personnel is often your highest cost </li></ul>Value Proposition For IBM Power Servers and i International Technology Group (June 2009)
    50. 50. Costs - Operational <ul><li>Operations </li></ul><ul><ul><li>Most shops don’t need a full time IBM i Admin </li></ul></ul><ul><ul><li>IBM i Admins are also DB2 DBA’s </li></ul></ul><ul><ul><li>Contractor rate $80 - $150 </li></ul></ul><ul><ul><li>Use less: </li></ul></ul><ul><ul><ul><li>Networking hardware and personnel </li></ul></ul></ul><ul><ul><ul><li>Floor space </li></ul></ul></ul><ul><ul><ul><li>Energy </li></ul></ul></ul>
    51. 51. Costs - Development Costs <ul><li>Simpler Applications </li></ul><ul><ul><li>Lower development time </li></ul></ul><ul><ul><li>Less maintenance cost </li></ul></ul><ul><ul><li>Less planning </li></ul></ul><ul><ul><ul><li>Reduce management work load </li></ul></ul></ul><ul><ul><li>Use of junior developers </li></ul></ul>
    52. 52. Vertical Ceiling <ul><li>Partition by function </li></ul><ul><ul><li>Dedicated database server </li></ul></ul><ul><ul><li>New functionality </li></ul></ul><ul><ul><li>Refactor current functionality </li></ul></ul><ul><li>Move to a larger vertical scaling system (System z) </li></ul>
    53. 53. Final Thoughts <ul><li>“ Everything should be made as simple as possible, but no simpler.” </li></ul><ul><li>Albert Einstein </li></ul>
    54. 54. Which Is Better? <ul><li>It’s all about the right tool at the right time. </li></ul>Neither
    55. 55. Use Case Scenarios <ul><li>Using Power System will: </li></ul><ul><ul><li>Provide a low man-power solution </li></ul></ul><ul><ul><li>Ability to use more junior level PHP developers </li></ul></ul><ul><ul><ul><li>Or not able to find super stars </li></ul></ul></ul><ul><ul><li>Use of IBM i contractor adds no extra load on “IT” or the DBAs </li></ul></ul>Staffing Problems You have a Hiring Freeze or just an inability to get new people, be them developers, DBA’s or system admin’s.
    56. 56. Use Case Scenarios <ul><li>Using Power System will: </li></ul><ul><ul><li>Allow you to rewrite the rules </li></ul></ul><ul><ul><li>Allow you to possibly change the balance of power </li></ul></ul>The “IT” Stalemate Red tape is killing productivity or your developers ability quickly get things done.
    57. 57. Questions?
    58. 58. Thank You! <ul><li>Please come find me if you have any more questions </li></ul><ul><li>Leave feedback at </li></ul>