Enterprise PHP

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites

    Enterprise PHP - Presentation Transcript

    1. PHPEE? The Enterprise PHP Architecture John Coggeshall Zend Technologies http://www.zend.com/
    2. Who am I?
      • Senior Technical Consultant for Zend
      • Author of PHP 5 Unleashed
      • Member of Zend Education Advisory Board
      • Maintainer of the Tidy, XMLRPCi, BLENC extensions for PHP 5
    3. Why am I here?
      • Obviously to talk about PHP in the Enterprise
      • But more to the point, where PHP fits in the Enterprise stack
      • Make an attempt to clarify the differences between PHP 5 / J2EE / .NET
      • Drink Beer
    4. Let's start off at the beginning
      • A few things I've noticed:
        • Defining what exactly is an “Enterprise Application” is pretty difficult
        • People mistake “Enterprise Applications” for technologies employing things such as J2EE / .NET / PHP
        • People don't identify Enterprise Architectures as a collection of patterns
    5. What's Enterprise anyway
      • Can you define “Enterprise” application?
      • Scalable
      • Large
      • Object Oriented
      • Oracle-based
      • Distributed
      • Cash-Cow
      • High Availability
      • Java Based
      • Complex
      • Many Users
    6. What's Enterprise anyway
      • Can you define “Enterprise” application?
      • Scalable
      • Large
      • Object Oriented
      • Oracle-based
      • Distributed
      • Cash-Cow
      • High Availability
      • Java Based
      • Complex
      • Many Users
      Does any of those things really define much of anything to you?
    7. A Definition I like..ish...
      • From Martin Fowler's “Patterns of Enterprise Application Architecture”...
      • A lot of data
      • Persistent data
      • Access to Data Concurrently
      • Integration
    8. Devil in the Details
      • Sounds like a great academic definition
        • As always, the implementation is just a little more complex
      • Implied Characteristics
        • Scalability
        • Availability
        • Integrity
    9. From Theory to Practice
      • Whatever your definition of Enterprise is, someone has to actually design an implementation
      • A lot of people mistake implementations for the definition
        • That ends up costing them a lot of money they might not have otherwise spent.
    10. Enterprise Architectures
      • Is J2EE an Enterprise Architecture?
      • Is .NET an Enterprise Architecture?
      • Short answer: Sure
      • Longer Answer: They are implementations of a set of Enterprise Design Patterns
    11. Design Patterns
      • I'm pretty sure most of us know what these are. Formally they are defined as:
        • A name
        • The core of a problem it aims to solve
        • The core of the solution to that problem
        • The consequences of using that solution
    12. Enterprise Design Patterns Deal with the details Enterprise Design Patterns Deal with the details - Scalability - High Availability - Integrity
    13. Enterprise Design Patterns
      • Design Patterns can be applied to more than just working with OO code
      • They can be applied to conceptual architectures
      • Could be implemented by any language with the aforementioned Enterprise capabilities
    14. So..?
      • J2EE is one application of design patterns to create an Enterprise Architecture
      • Accomplishes most of the goals required by large-scale Enterprise applications
      • But: Generic Problems Lead to Generic Solutions
    15. Not everything is a nail
      • While J2EE succeeds in many ways, it's really not designed for the “Web Problem”
      • The amount of effort put into even simple applications is crazy
      • There are simpler ways to do this stuff
    16. This is where PHP comes in
      • In general, PHP developers can produce the same web site as a JSP developer in 25-50% less time
      • That's not BS either
        • PayPal's Sample Integration for PHP took me about 8 days, the Java guy had been working on it for about a month.
    17. I'm not saying Java sucks
      • It's not that Java/J2EE sucks, PHP is just better at the web problem
      • On the other hand, PHP pretty much sucks at the Enterprise backend problem
      • But with our power's combined....
      ♥ Java
    18. The PHP / Java Bridge
      • This is pretty sexy:
    19. Using a Screwdriver
      • If J2EE is really good at the back-end..
      • ... and PHP is really good at the front end
      • ... and they can play nice together
      • I think you get the picture
      • Remember, you can implement the same design patterns in PHP 5 as you do in J2EE!
    20. Example PHP/Java Architecture
    21. For those who are pure PHP
      • Of course PHP is more than able to develop Enterprise applications alone
      • Many of the same patterns that apply to J2EE/.NET will work the same in PHP
      • To answer: PHP works great in Enterprise environments, it just doesn't force you into a pre-designed mold (good and bad)
    22. PHP Specific Patterns
      • There are a lot of Design Patterns which apply specifically to PHP in Enterprise Environments
      • Esp. when dealing with specific types of technology (Apache, MySQL, etc).
      • Let's check a few of them out
    23. Scaling with MySQL
      • I assume you know about MySQL.
        • Replication is hot, if you do things right in PHP
      • Scales great until your writes exceed what can be done on a single machine
        • That's almost not true anymore, but for now it is.
    24. MySQL Architecture
      • Often when writing Heavy-hitting PHP applications the biggest issue is the back-end database
      • When doing a pure PHP implementation, good MySQL knowledge is important
      • Let's look at a great MySQL architectural pattern
    25. MySQL Replication Pattern
    26. MySQL Replication Pattern
      • Works great, but you have to account for it in your PHP applications
        • Application DB abstractions should provide different facilities at the API level for reading/writing to the DB and perhaps a third for FULLTEXT searching
        • Even if you don't need it now, a little planning goes a long way
    27. Leverage mod_rewrite
      • If you're web application has a lot of semi-static content
        • Content that could change so it has to be stored in the DB, but almost never does
      • .. And you're running on Apache
      • This Design Pattern is killer!
    28. Leverage mod_rewrite
      • Most people in PHP would implement a page like this:
        • http://www.example.com/show_article.php?id=5
      • This would be responsible for generating the semi-static page HTML for the browser
    29. Leverage mod_rewrite
      • Instead of generating the HTML for the browser, make this script generate another PHP script that contains mostly static content
        • Keep things like personalization code, but make the actual article itself static in the file
        • Write the file to disk in a public folder under document root
    30. Leverage mod_rewrite
      • If you put them in this directory
        • http://www.example.com/articles/5.php
      • You can create a mod_rewrite rule such that
        • http://www.example.com/articles/5.php maps to
        • http://www.example.com/show_article.php?id=5
      • Since show_article.php writes files to articles, once it's been generated no more DB reads!
    31. Leverage mod_rewrite
      • Simple and Elegant Solution
      • Allows you to keep pages “personalized”
      • Very easy to Maintain
      • Credit goes to Theo Schlossnagle (?)
    32. Improving PHP Performance
      • Improving the speed of PHP can be done very easily using an opcode cache
    33. So, if you want pure PHP
    34. Or you have an existing back-end....
    35. PHP is enterprise ready! Thank you! Questions? Buy My Book!

    + John CoggeshallJohn Coggeshall, 3 years ago

    custom

    1185 views, 3 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1185
      • 1124 on SlideShare
      • 61 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 49
    Most viewed embeds
    • 61 views on http://www.coggeshall.org

    more

    All embeds
    • 61 views on http://www.coggeshall.org

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories