Non-framework Non-framework MVC site MVC site http://www.flickr.com/photos/alex_stanoi/2692787831/ Cesar D. Rodas Cesar D. Rodas http://crodas.org/ http://crodas.org/ - - http://cesar.la/ http://cesar.la/ @crodas crodas
Non-framework Non-framework MVC siteMVC site
http://www.flickr.com/photos/alex_stanoi/2692787831/
Cesar D. RodasCesar D. Rodashttp://crodas.org/http://crodas.org/ - - http://cesar.la/http://cesar.la/
@@crodascrodas
http://www.flickr.com/photos/hm2k/3276868036/
PHP?who are using it?
`
OK, OK got it.OK, OK got it.but why don't you use a but why don't you use a
framework?framework?
““As much easier for the As much easier for the developer, harder for the developer, harder for the
computer”computer”
Talk is cheap, show me the Talk is cheap, show me the codecode
http://www.flickr.com/photos/powerpig/3614473636/
Let's build a Twitter-clone
http://www.flickr.com/photos/powerpig/3614473636/
● PHP 5
● Simple-ORM
● MySQL
● MongoDB
git clone http://crodas.org/latinoware-2009.git
http://www.flickr.com/photos/herr_akx/399196999/
Public domain
http://www.flickr.com/photos/herr_akx/399196999/
Coding in layers you can do crazy things.
http://www.flickr.com/photos/herr_akx/399196999/
. . . such as, let's drop MySQL and use MongoDB
http://www.flickr.com/photos/herr_akx/399196999/
git pull origin mongo
http://www.flickr.com/photos/herr_akx/399196999/
● C++'s revenge
● Super simple
● More than just key-value
● Think in documents, no tables
● Sharding
● Pretty fast (at least on my tests)
● JSON-like
MySQL's problems (and RBDMS in general)
● High abstraction at a high price
● Really hard to make it fault tolerant
● Most web-sites (except for those which deals
with money) doesn't really need a RDBMS
● Out-of-the-box solution for small/medium web-
sites
Scaling up to the sky
http://www.flickr.com/photos/lecates/536763868/
● Fast front end server (Nginx, perbal)
● Avoid re-do the same thing twice (client cache)
● Static files to front end, scripts to back end
● Use MongoDB (or might be CouchDB)
● KISS
● DNS round-robin across many front-ends
http://www.flickr.com/photos/lecates/536763868/
Conclusions
● If a framework is enough for you, go for it
● Done by hand is better, and much more efficient
● Small-efforts at long terms are better
http://www.flickr.com/photos/lecates/536763868/