Non-framework
      MVC site

      Cesar D. Rodas
 http://crodas.org/ - http://cesar.la/
               @crodas




                                 http://www.flickr.com/photos/alex_stanoi/2692787831/
http://www.flickr.com/photos/hm2k/3276868036/
PHP?
who are using it?
`
OK, OK got it.
but why don't you use a
      framework?
“As much easier for the
developer, harder for the
       computer”
Talk is cheap, show me the
           code
Let's build a Twitter-clone




           http://www.flickr.com/photos/powerpig/3614473636/
●   PHP 5

●   Simple-ORM

●   MySQL

●   MongoDB


              http://www.flickr.com/photos/powerpig/3614473636/
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/

Non-Framework MVC sites with PHP

  • 1.
    Non-framework MVC site Cesar D. Rodas http://crodas.org/ - http://cesar.la/ @crodas http://www.flickr.com/photos/alex_stanoi/2692787831/
  • 2.
  • 3.
  • 6.
  • 10.
    OK, OK gotit. but why don't you use a framework?
  • 11.
    “As much easierfor the developer, harder for the computer”
  • 12.
    Talk is cheap,show me the code
  • 13.
    Let's build aTwitter-clone http://www.flickr.com/photos/powerpig/3614473636/
  • 14.
    PHP 5 ● Simple-ORM ● MySQL ● MongoDB http://www.flickr.com/photos/powerpig/3614473636/
  • 15.
    git clone http://crodas.org/latinoware-2009.git http://www.flickr.com/photos/herr_akx/399196999/
  • 16.
    Public domain http://www.flickr.com/photos/herr_akx/399196999/
  • 17.
    Coding in layersyou can do crazy things. http://www.flickr.com/photos/herr_akx/399196999/
  • 18.
    ... such as,let's drop MySQL and use MongoDB http://www.flickr.com/photos/herr_akx/399196999/
  • 19.
    git pull originmongo http://www.flickr.com/photos/herr_akx/399196999/
  • 20.
    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
  • 21.
    MySQL's problems (andRBDMS 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
  • 22.
    Scaling up tothe sky http://www.flickr.com/photos/lecates/536763868/
  • 23.
    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/
  • 24.
    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/