39
Modern Application Stacks Chris Hartjes GTA PHP User's Group May 3, 2011

Modern Application Stacks

Embed Size (px)

Citation preview

Page 1: Modern Application Stacks

Modern Application Stacks

Chris HartjesGTA PHP User's Group

May 3, 2011

Page 2: Modern Application Stacks
Page 3: Modern Application Stacks

What Are We GoingTo Talk About

NO silver bulletsNO group-think NO fixation on the sexy-shiny

Page 4: Modern Application Stacks

LAMP is dead

LONG LIVE LAMP

Why do people hate LAMP so much?

Page 5: Modern Application Stacks

PHP Application Stacks

LinuxApacheMySQL

PHP

Page 6: Modern Application Stacks

PHP Application Stacks

Linux | OS-X | WindowsApache | Nginx | Lighttpd | IIS

MySQL | Postgres | SQL Server | Mongo | Couchdb

PHP + Javascript

Page 7: Modern Application Stacks

The cool kids might say otherwise...

LAMP is good enough for YOU

Worry about PSS(Precious Snowflake Syndrome)

Page 8: Modern Application Stacks
Page 9: Modern Application Stacks

TOY

vs.

BUSINESS VALUE

Page 10: Modern Application Stacks

What is a basic PHP application?

Something that accepts a requestSomething that persists data

Some that routes your requestSomething that displays the response

Page 11: Modern Application Stacks

Explosion of PHP Frameworkscauses a lack of focus

Built for the webShare-nothing

3rd party integration

Page 12: Modern Application Stacks

SOMETHING THAT ACCEPTSYOUR WEB REQUESTS

Apache?Lighttpd?Nginx?

IIS?

IT DOES NOT MATTER

Page 13: Modern Application Stacks
Page 14: Modern Application Stacks

Every choice can handlemodern needs

URL re-writingAbility to pass through dynamic requests

Compressing data before serving

Page 15: Modern Application Stacks

STFU And Tell Us!

Apache – well-understood, easy to get helpNginx + Lighttpd require PHP configuration

New tools required for monitoring FCGI

Page 16: Modern Application Stacks

Web-server modules are the keyApache + Nginx works too!

Page 17: Modern Application Stacks

SOME PERSISTENCEOF DATA

NoSQL or RDBMS?Clustered or not-clustered?

DEPENDS ON THE DATA

Page 18: Modern Application Stacks

Domain model?

Heavy reads?

Heavy writes?

Page 19: Modern Application Stacks

STEP 1: FIGURE OUT RELATIONSHIPS

STEP 2: FIGURE OUT USAGE PATTERNS

STEP 3: PROFIT?

Page 20: Modern Application Stacks

DATA MODEL

Key-value?Document?Relational?

Page 21: Modern Application Stacks

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

Page 22: Modern Application Stacks

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.”

Page 23: Modern Application Stacks

STFU and Tell Us!

Page 24: Modern Application Stacks

SOMETHING THATROUTES YOUR REQUEST

ROUTING ISNOT SEXY

Page 25: Modern Application Stacks

SOMETHING THATROUTES YOUR REQUEST

Frameworks the quickest wayWeb server rewrite rules for the hardcore

Front controller or page controller

Page 26: Modern Application Stacks

STFU and Tell Us!

System should react to HTTP verbsSystem should allow reuse of URLs

Page 27: Modern Application Stacks

SOMETHING THATDISPLAYS THE RESPONSE

TEMPLATING SYSTEMSARE NOT SEXY

Page 28: Modern Application Stacks

SOMETHING THATDISPLAYS THE RESPONSE

Frameworks the quickest wayDesigners can learn PHP too!

Careful about use of custom tagsPHP is a TEMPLATING LANGUAGE

Page 29: Modern Application Stacks

STFU And Tell Us!

Picking a templating “language” is simply yak shaving

Page 30: Modern Application Stacks

STFU And Tell Us!

What stack you use actually matters very little

Page 31: Modern Application Stacks

Essential Add-ons

Alternate PHP Cache(APC)

Opcode caching for performanceUser-space caching

Page 32: Modern Application Stacks

Essential Add-ons

Memcache

In-memory key-value storageMembase (Memcache + persistence)

Redis (Memcache compatible)

Page 33: Modern Application Stacks

TO THE CLOUD!

Page 34: Modern Application Stacks
Page 35: Modern Application Stacks
Page 36: Modern Application Stacks

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.”

Page 37: Modern Application Stacks

Now Architecture Matters

Performance differentCount on components disappearing

Application architecture matters!

Page 38: Modern Application Stacks
Page 39: Modern Application Stacks

THANK YOU

Questions?

Comments?

Complaints

http://www.littlehart.net/atthekeyboard