non-framework mvc sites with php

24
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

Upload: cesar-rodas

Post on 18-Dec-2014

4.476 views

Category:

Technology


4 download

DESCRIPTION

Non-Framework MVC sites with PHP

TRANSCRIPT

Page 1: Non-Framework MVC sites with PHP

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

Page 2: Non-Framework MVC sites with PHP

http://www.flickr.com/photos/hm2k/3276868036/

Page 3: Non-Framework MVC sites with PHP

PHP?who are using it?

Page 4: Non-Framework MVC sites with PHP
Page 5: Non-Framework MVC sites with PHP
Page 6: Non-Framework MVC sites with PHP

`

Page 7: Non-Framework MVC sites with PHP
Page 8: Non-Framework MVC sites with PHP
Page 9: Non-Framework MVC sites with PHP
Page 10: Non-Framework MVC sites with PHP

OK, OK got it.OK, OK got it.but why don't you use a but why don't you use a

framework?framework?

Page 11: Non-Framework MVC sites with PHP

““As much easier for the As much easier for the developer, harder for the developer, harder for the

computer”computer”

Page 12: Non-Framework MVC sites with PHP

Talk is cheap, show me the Talk is cheap, show me the codecode

Page 13: Non-Framework MVC sites with PHP

http://www.flickr.com/photos/powerpig/3614473636/

Let's build a Twitter-clone

Page 14: Non-Framework MVC sites with PHP

http://www.flickr.com/photos/powerpig/3614473636/

● PHP 5

● Simple-ORM

● MySQL

● MongoDB

Page 15: Non-Framework MVC sites with PHP

git clone http://crodas.org/latinoware-2009.git

http://www.flickr.com/photos/herr_akx/399196999/

Page 16: Non-Framework MVC sites with PHP

Public domain

http://www.flickr.com/photos/herr_akx/399196999/

Page 17: Non-Framework MVC sites with PHP

Coding in layers you can do crazy things.

http://www.flickr.com/photos/herr_akx/399196999/

Page 18: Non-Framework MVC sites with PHP

. . . such as, let's drop MySQL and use MongoDB

http://www.flickr.com/photos/herr_akx/399196999/

Page 19: Non-Framework MVC sites with PHP

git pull origin mongo

http://www.flickr.com/photos/herr_akx/399196999/

Page 20: Non-Framework MVC sites with PHP

● 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

Page 21: Non-Framework MVC sites with PHP

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

Page 22: Non-Framework MVC sites with PHP

Scaling up to the sky

http://www.flickr.com/photos/lecates/536763868/

Page 23: Non-Framework MVC sites with PHP

● 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/

Page 24: Non-Framework MVC sites with PHP

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/