3 ms·
But as soon as you move away from simple apps under light load into real applications, it is no longer enough just to rely on PHP magic. You find yourself needi
by nostrademons 17y ago
But as soon as you move away from simple apps under light load into real applications, it is no longer enough just to rely on PHP magic. You find yourself needing to understand the innards of what is a very complex environment, and dealing with an idiosyncratic development community that considers ad-hoc exposure of C libraries a neat programming techinique, and likes to publish its documentation as comments on a web page. ;-)
PHP occupies an unfortunate middle-ground: it's less productive than Rails or Django, but less performant than C++. If your site really gets to Google- or EBay- or Facebook- or Twitter-scale, it's probably worth rewriting it in C++.
PHP, Python, and Ruby all have fairly easy-to-use C interfaces, so it's not that hard to link in the performance critical parts later as you rewrite them. Given that PHP isn't an effective final solution anyway, why not start with something a bit more sane?
- idlewords 17y agoPHP isn't an effective final solution? Yahoo uses it as the front-end language for tons of stuff.
- nostrademons 17y agoRuby on Rails isn't an effective solution? Twitter uses it as the front-end language for tons of stuff.
- idlewords 17y agoIt's not. Twitter ended up having to move the guts of the service off Rails to handle growth, back when it was a small fraction of the size of a typical Yahoo property. Also, the comparison doesn't really make much sense. ORM is at the heart of Rails, and the framework has a very intimate relationship with a backing data store. At a company like Yahoo, PHP is used as a kind of presentation layer that communicates with various backend services that do the heavy lifting. It's a different architectural model, designed to avoid precisely the kind of problems you get scaling Rails (or Django, or your favorite framework).
- nostrademons 17y agoAFAIK, Twitter is doing exactly the same thing with Rails that Yahoo is doing with PHP. They ditch the ORM and use it as a thin presentation layer over RPC calls. I don't know too many intimate details of Rails, but ORM is most certainly not at the heart of Django. It's quite common to drop the model layer entirely and run it on top of either RPCs or a different backing data store (see AppEngine, for example, and every Django app I've written at Google). ORMs have well-known performance problems - a couple startups ago, I was doing webapps in Java, and we found that relying on Hibernate gave us an instant 5x slowdown over raw JDBC calls, and far more than that relative to our proprietary database.