By John Coggeshall and Marc Urbaitel ENTERPRISE PHP: A CASE STUDY
INTRODUCTIONS <ul><li>Who am I: </li></ul><ul><ul><li>John Coggeshall </li></ul></ul><ul><ul><li>Architect, North American...
INTRODUCTIONS <ul><li>Who did I work with? </li></ul><ul><ul><li>Marc Urbaitel </li></ul></ul><ul><ul><li>CTO & Co-Founder...
SESSION AGENDA <ul><li>Introductions </li></ul><ul><li>History </li></ul><ul><li>Technical Details </li></ul><ul><li>Demo ...
HISTORY <ul><li>In Ticketing, Inc. </li></ul><ul><ul><li>Founded in 1999 (Formerly InHouse Ticketing) </li></ul></ul><ul><...
THE PROBLEM <ul><li>Organically grown web application </li></ul><ul><ul><li>Hard to add features (i.e. new up-sell opportu...
START WITH DUCT TAPE <ul><li>In existing system hardware wouldn't solve the problem </li></ul><ul><ul><li>System itself wa...
KEY APPLICATION CONCERNS <ul><li>Load Pattern is Spiked </li></ul><ul><ul><li>Associated with Ticket Sale Start </li></ul>...
KEY APPLICATION CONCERNS <ul><li>Load is usually focused on a small subsection of clients </li></ul><ul><li>Translation: S...
THE SOLUTION: OLT (Online Ticketing) <ul><li>Re-write of entire application not an option </li></ul><ul><ul><li>Too expens...
PROJECT FOCUS May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  Admin is for Clients, which create events...
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  Ticket Meta Data is replicated  as SQLite...
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  Online Orders come through the event serv...
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  The OLT Cluster Manages Ticket Allotments...
HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  Box office orders use stored procedures t...
THE OLT CLUSTER <ul><li>An OLT Cluster consists of at least: </li></ul><ul><ul><li>One Web Server </li></ul></ul><ul><ul><...
THE OLT CLUSTER SERVERS <ul><li>Database: MySQL 5.0 </li></ul><ul><ul><li>Utilizes Stored Procedures to Encapsulate comple...
TRULY SCALABLE <ul><li>Each cluster is self-contained </li></ul><ul><li>A single OLT cluster can scale  up and down </li><...
DATABASE SCHEMAS <ul><li>Previous Implementation has  183  tables in MySQL </li></ul><ul><ul><li>At least 7 tables directl...
DATABASE SCHEMAS <ul><li>Most OLT data is  read-only  and stored locally on every server as a series of SQLite Databases <...
DATABASE SCHEMAS May 28, 2009 NAME OF THE SESSION COMES HERE PAGE  MySQL read/write DB schema
WEB APPLICATION ARCHITECTURE <ul><li>~ 30,000 lines of code and ~160 classes </li></ul><ul><ul><li>Broken into two librari...
MVC DETAILS <ul><li>Built using Zend Framework Model / View / Controller (MVC) </li></ul><ul><ul><li>8 Controllers total m...
BASIC ORDER FLOW <ul><li>Real Time Flow </li></ul><ul><ul><li>Process Captcha </li></ul></ul><ul><ul><li>Identify Language...
UNDER THE HOOD <ul><li>Order Process </li></ul><ul><ul><li>Order is gathered </li></ul></ul><ul><ul><li>Consolidated into ...
ASYNCHRONOUS BACKEND <ul><li>Order is then passed into the Job Queue to process numerous asynchronous tasks </li></ul><ul>...
WHAT DOES THIS ALL MEAN FOR INTICKETING? <ul><li>Scalable solution means when the next big client comes they can say  YES ...
WHAT’S NEXT FOR OLT? <ul><li>New event listing architecture </li></ul><ul><ul><li>Current bottleneck in system is the even...
THANK YOU! Questions? Comments? Suggestions?
Upcoming SlideShare
Loading in …5
×

Enterprise PHP: A Case Study

11,449 views

Published on

These are the slides from my ZendCon 2007 talk on a project we did in Professional Services to basically rebuild from scratch InTicketing's (TicketMaster competitor) e-commerce engine using Zend technologies. It was very well received (not even standing room) and well worth a look!

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

No Downloads
Views
Total views
11,449
On SlideShare
0
From Embeds
0
Number of Embeds
84
Actions
Shares
0
Downloads
0
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide

Enterprise PHP: A Case Study

  1. 1. By John Coggeshall and Marc Urbaitel ENTERPRISE PHP: A CASE STUDY
  2. 2. INTRODUCTIONS <ul><li>Who am I: </li></ul><ul><ul><li>John Coggeshall </li></ul></ul><ul><ul><li>Architect, North American Professional Services </li></ul></ul><ul><ul><li>PHP 5 Core Contributor </li></ul></ul><ul><ul><li>Author: PHP 5 Unleashed </li></ul></ul><ul><ul><li>Member of Zend’s Education Advisory Board </li></ul></ul>May 28, 2009 Enterprise PHP: A Case Study PAGE
  3. 3. INTRODUCTIONS <ul><li>Who did I work with? </li></ul><ul><ul><li>Marc Urbaitel </li></ul></ul><ul><ul><li>CTO & Co-Founder In Ticketing </li></ul></ul><ul><ul><li>PHP Programmer </li></ul></ul><ul><ul><li>Chief Architect of Existing Ticketing System </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  4. 4. SESSION AGENDA <ul><li>Introductions </li></ul><ul><li>History </li></ul><ul><li>Technical Details </li></ul><ul><li>Demo </li></ul><ul><li>Questions </li></ul>May 28, 2009 Enterprise PHP: A Case Study PAGE
  5. 5. HISTORY <ul><li>In Ticketing, Inc. </li></ul><ul><ul><li>Founded in 1999 (Formerly InHouse Ticketing) </li></ul></ul><ul><ul><li>Competitor to Ticket Master </li></ul></ul><ul><ul><li>Full Service Ticketing Provider </li></ul></ul><ul><li>System built entirely on PHP/MySQL Platform </li></ul>May 28, 2009 Enterprise PHP: A Case Study PAGE
  6. 6. THE PROBLEM <ul><li>Organically grown web application </li></ul><ul><ul><li>Hard to add features (i.e. new up-sell opportunities) </li></ul></ul><ul><ul><ul><li>Ticket Insurance </li></ul></ul></ul><ul><ul><ul><li>&quot;Green&quot; up your experience </li></ul></ul></ul><ul><ul><li>Even harder to scale to meet client demand </li></ul></ul><ul><ul><ul><li>Wants to be able to process roughly 25,000 ticket transactions per minute </li></ul></ul></ul><ul><ul><ul><li>Or … ~85 tickets per second </li></ul></ul></ul><ul><ul><ul><li>Or … 300-400+ requests per second </li></ul></ul></ul><ul><li>Must maintain current reporting / site admin facilities used by clients </li></ul>May 28, 2009 Enterprise PHP: A Case Study PAGE
  7. 7. START WITH DUCT TAPE <ul><li>In existing system hardware wouldn't solve the problem </li></ul><ul><ul><li>System itself wasn't scalable </li></ul></ul><ul><li>Initial Solution: Serialize the ticket process for customers </li></ul><ul><ul><li>Customers would be placed into a virtual queue and released in small groups to purchase tickets </li></ul></ul><ul><ul><li>Resulted in online wait times to begin order process anywhere from 30 minutes to 2 hours </li></ul></ul><ul><ul><li>Kept the request/second requirement low enough for system to handle </li></ul></ul><ul><ul><li>It worked, but was only a temporary solution </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  8. 8. KEY APPLICATION CONCERNS <ul><li>Load Pattern is Spiked </li></ul><ul><ul><li>Associated with Ticket Sale Start </li></ul></ul><ul><ul><li>Usually associated with a single concert, etc. </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Note: Simulated Data
  9. 9. KEY APPLICATION CONCERNS <ul><li>Load is usually focused on a small subsection of clients </li></ul><ul><li>Translation: System needs to scale down to at least the event level </li></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Note: Simulated Data
  10. 10. THE SOLUTION: OLT (Online Ticketing) <ul><li>Re-write of entire application not an option </li></ul><ul><ul><li>Too expensive to re-write entire online business </li></ul></ul><ul><li>Instead, separate out the important bits </li></ul><ul><ul><li>Re-write the online order engine, integrate with old system </li></ul></ul><ul><ul><li>Significantly less effort and will solve most of the goal </li></ul></ul><ul><ul><ul><li>Offload integration points outside of web request </li></ul></ul></ul><ul><ul><ul><li>Keep local copies of data on each server and sync as necessary </li></ul></ul></ul><ul><ul><ul><li>New Architecture will allow easy improvements / ongoing maintenance </li></ul></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  11. 11. PROJECT FOCUS May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  12. 12. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  13. 13. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Admin is for Clients, which create events and view reporting (Ticket Metadata)
  14. 14. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Ticket Meta Data is replicated as SQLite databases on each OLT server (read-only)
  15. 15. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Online Orders come through the event server and are handed off to OLT once the transaction beings
  16. 16. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE The OLT Cluster Manages Ticket Allotments, transaction, reporting back the order results to the reporting system
  17. 17. HIGH LEVEL SERVER ARCHITECTURE May 28, 2009 NAME OF THE SESSION COMES HERE PAGE Box office orders use stored procedures to access allotments in their respective OLT to complete orders
  18. 18. THE OLT CLUSTER <ul><li>An OLT Cluster consists of at least: </li></ul><ul><ul><li>One Web Server </li></ul></ul><ul><ul><li>One Database Server </li></ul></ul><ul><ul><li>One Job Queue Server </li></ul></ul><ul><li>Cluster Database Performance is Glass Ceiling </li></ul><ul><ul><li>Can add Job Queue, Web servers </li></ul></ul><ul><ul><li>Can also add slaves, replace with MySQL cluster, etc. </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  19. 19. THE OLT CLUSTER SERVERS <ul><li>Database: MySQL 5.0 </li></ul><ul><ul><li>Utilizes Stored Procedures to Encapsulate complex allotment management </li></ul></ul><ul><li>Web Server: PHP 5.2 </li></ul><ul><ul><li>ZC2, Platform, Zend Framework </li></ul></ul><ul><li>Job Queue: PHP 5.2 </li></ul><ul><li>InTicketing specific Frameworks: OLT, In </li></ul><ul><ul><li>Built on ZF </li></ul></ul><ul><li>Front End: ZF MVC </li></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  20. 20. TRULY SCALABLE <ul><li>Each cluster is self-contained </li></ul><ul><li>A single OLT cluster can scale up and down </li></ul><ul><ul><li>One cluster can run entire business </li></ul></ul><ul><ul><li>.. Or one client </li></ul></ul><ul><ul><li>.. Or one event </li></ul></ul><ul><ul><li>.. Or a single ticket allotment </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  21. 21. DATABASE SCHEMAS <ul><li>Previous Implementation has 183 tables in MySQL </li></ul><ul><ul><li>At least 7 tables directly related to a ticket order used every request </li></ul></ul><ul><ul><li>Remainder related to admin / reporting / etc. </li></ul></ul><ul><li>OLT: 5 tables total in MySQL </li></ul><ul><ul><li>3 of which are used during the web request </li></ul></ul><ul><ul><li>InnoDB tables </li></ul></ul><ul><ul><li>Replaced complex JOINs with composite keys (Ticket SKUs) </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  22. 22. DATABASE SCHEMAS <ul><li>Most OLT data is read-only and stored locally on every server as a series of SQLite Databases </li></ul><ul><ul><li>One DB per 'Nug' (client selling tickets) </li></ul></ul><ul><li>Only low-traffic admin systems from legacy touch OLT MySQL Database (for allotment updates) </li></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  23. 23. DATABASE SCHEMAS May 28, 2009 NAME OF THE SESSION COMES HERE PAGE MySQL read/write DB schema
  24. 24. WEB APPLICATION ARCHITECTURE <ul><li>~ 30,000 lines of code and ~160 classes </li></ul><ul><ul><li>Broken into two libraries, OLT and IN plus front-end </li></ul></ul><ul><li>The OLT Library </li></ul><ul><ul><li>Heart of OLT system </li></ul></ul><ul><ul><li>Handles all major functionality of system </li></ul></ul><ul><li>The IN Library </li></ul><ul><ul><li>Support Library </li></ul></ul><ul><ul><li>Provides functionality which isn't OLT-specific for code-reuse reasons </li></ul></ul><ul><ul><li>Contains Transaction Engine, Custom Filters/Validators, Customer / Transaction information objects </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  25. 25. MVC DETAILS <ul><li>Built using Zend Framework Model / View / Controller (MVC) </li></ul><ul><ul><li>8 Controllers total manage the entire order process </li></ul></ul><ul><ul><li>Orders are began by posting to the correct OLT engine the details </li></ul></ul><ul><ul><ul><li>Which tickets to buy / quantity </li></ul></ul></ul><ul><ul><ul><li>Meta data for order </li></ul></ul></ul><ul><ul><li>OLT manages entire order process and triggers backend job to complete transaction </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  26. 26. BASIC ORDER FLOW <ul><li>Real Time Flow </li></ul><ul><ul><li>Process Captcha </li></ul></ul><ul><ul><li>Identify Language & Skinning of Order </li></ul></ul><ul><ul><li>Temporarily Reserve Tickets During Order </li></ul></ul><ul><ul><li>Gather Customer Information </li></ul></ul><ul><ul><li>Perform Ticket Transaction </li></ul></ul><ul><li>Asynchronous Operations </li></ul><ul><ul><li>Perform up-sell transactions </li></ul></ul><ul><ul><li>Generate PDF tickets </li></ul></ul><ul><ul><li>Store Order Data </li></ul></ul><ul><ul><li>Send E-mails </li></ul></ul><ul><ul><li>Etc. </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  27. 27. UNDER THE HOOD <ul><li>Order Process </li></ul><ul><ul><li>Order is gathered </li></ul></ul><ul><ul><li>Consolidated into single object </li></ul></ul><ul><li>Order contains everything possibly known about the transaction at hand </li></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  28. 28. ASYNCHRONOUS BACKEND <ul><li>Order is then passed into the Job Queue to process numerous asynchronous tasks </li></ul><ul><ul><li>Primary Ticket Transaction is still real time </li></ul></ul><ul><li>Transactions can happen through numerous gateways </li></ul>May 28, 2009 #
  29. 29. WHAT DOES THIS ALL MEAN FOR INTICKETING? <ul><li>Scalable solution means when the next big client comes they can say YES to their business </li></ul><ul><ul><li>Larger volumes can now be handled just by purchasing more hardware </li></ul></ul><ul><li>Added Revenue Streams adds to bottom line </li></ul><ul><ul><li>PayPal Express Checkout </li></ul></ul><ul><ul><li>Ticket Insurance </li></ul></ul><ul><ul><li>Green your Experience </li></ul></ul><ul><li>Broader Marketplace </li></ul><ul><ul><li>International clients thanks to built in internationalization </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  30. 30. WHAT’S NEXT FOR OLT? <ul><li>New event listing architecture </li></ul><ul><ul><li>Current bottleneck in system is the event landing pages </li></ul></ul><ul><li>Optimization of Cluster </li></ul><ul><ul><li>Improving minimum cluster overall performance lowers cost per ticket </li></ul></ul><ul><li>More Features </li></ul><ul><ul><li>New Upsells </li></ul></ul><ul><ul><li>Different types of events (Cruises, etc) </li></ul></ul><ul><ul><li>More Reporting, Introspection </li></ul></ul>May 28, 2009 NAME OF THE SESSION COMES HERE PAGE
  31. 31. THANK YOU! Questions? Comments? Suggestions?

×