modern application stacks
TRANSCRIPT
Modern Application Stacks
Chris HartjesGTA PHP User's Group
May 3, 2011
What Are We GoingTo Talk About
NO silver bulletsNO group-think NO fixation on the sexy-shiny
LAMP is dead
LONG LIVE LAMP
Why do people hate LAMP so much?
PHP Application Stacks
LinuxApacheMySQL
PHP
PHP Application Stacks
Linux | OS-X | WindowsApache | Nginx | Lighttpd | IIS
MySQL | Postgres | SQL Server | Mongo | Couchdb
PHP + Javascript
The cool kids might say otherwise...
LAMP is good enough for YOU
Worry about PSS(Precious Snowflake Syndrome)
TOY
vs.
BUSINESS VALUE
What is a basic PHP application?
Something that accepts a requestSomething that persists data
Some that routes your requestSomething that displays the response
Explosion of PHP Frameworkscauses a lack of focus
Built for the webShare-nothing
3rd party integration
SOMETHING THAT ACCEPTSYOUR WEB REQUESTS
Apache?Lighttpd?Nginx?
IIS?
IT DOES NOT MATTER
Every choice can handlemodern needs
URL re-writingAbility to pass through dynamic requests
Compressing data before serving
STFU And Tell Us!
Apache – well-understood, easy to get helpNginx + Lighttpd require PHP configuration
New tools required for monitoring FCGI
Web-server modules are the keyApache + Nginx works too!
SOME PERSISTENCEOF DATA
NoSQL or RDBMS?Clustered or not-clustered?
DEPENDS ON THE DATA
Domain model?
Heavy reads?
Heavy writes?
STEP 1: FIGURE OUT RELATIONSHIPS
STEP 2: FIGURE OUT USAGE PATTERNS
STEP 3: PROFIT?
DATA MODEL
Key-value?Document?Relational?
RDBMS are high-performing and reliableMake great key-value stores (ala Reddit)
MySQL will never page you at 3 AM due to obscure replication bug
UNSEXY GETS THE JOB DONE
http://teddziuba.com/2010/03/i-cant-wait-for-nosql-to-die.html
You Are Not Google
“The sooner your company admits this, the sooner you can get down to some real work. Developing the app for Google-sized scale is a waste of your time, plus, there is no way you will get it right. Absolutely none. It's not that you're not smart enough, it's that you do not have the experience to know what problems you will see at scale.”
STFU and Tell Us!
SOMETHING THATROUTES YOUR REQUEST
ROUTING ISNOT SEXY
SOMETHING THATROUTES YOUR REQUEST
Frameworks the quickest wayWeb server rewrite rules for the hardcore
Front controller or page controller
STFU and Tell Us!
System should react to HTTP verbsSystem should allow reuse of URLs
SOMETHING THATDISPLAYS THE RESPONSE
TEMPLATING SYSTEMSARE NOT SEXY
SOMETHING THATDISPLAYS THE RESPONSE
Frameworks the quickest wayDesigners can learn PHP too!
Careful about use of custom tagsPHP is a TEMPLATING LANGUAGE
STFU And Tell Us!
Picking a templating “language” is simply yak shaving
STFU And Tell Us!
What stack you use actually matters very little
Essential Add-ons
Alternate PHP Cache(APC)
Opcode caching for performanceUser-space caching
Essential Add-ons
Memcache
In-memory key-value storageMembase (Memcache + persistence)
Redis (Memcache compatible)
TO THE CLOUD!
What Orchestra Offers
“The idea is that we aren't the dated LAMP stack but rather a more modern nginx, load-balanced, caching, php-fpm, mongo, etc.”
“A platform built for today and tomorrows needs instead of a traditional platform made to handle the problems we had 10-15 years
ago.”
Now Architecture Matters
Performance differentCount on components disappearing
Application architecture matters!
THANK YOU
Questions?
Comments?
Complaints
http://www.littlehart.net/atthekeyboard