Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the rationale behind the claim "PHP doesn't scale up (well)"? [closed]

I've recently picked up PHP and it seems rather neat language enabling very quick web application development (probably faster than my personal favorite - Java :)

Now, I'm no PHP expert - neither with the language nor its internals/specifics. But quite a few of my peers have made the claim that PHP applications don't scale up well - a fact that I've not been able to figure out for myself and hence the question.

I've just learnt the procedural flavor of PHP and my only guess of non-scalability is that of scalability of procedural vs. OO languages (C vs. C++/Java). I agree and and I can see how that would be a hurdle for extremely complex web applications. However, I'm aware of OO-ness coming to the PHP world and don't see that to be much of a hurdle (please correct me if my hypothesis is incorrect).

Other than that I don't understand what scalability problems would arise for a web application with a large number of users (for the sake of discussion, let's assume a Restful design - no sessions - since I am aware of how that impedes scalability). I'm more interested in knowing 'objective' reasons for such a claim, if possible. Subjectivity is fine but I'm not here to start a debate as to PHP vs. everything else. I'm only interested in knowing what are the potential limitations of this language that I must keep in mind and should not bite me in the behind later if/when the web application were to have 1000's of users a day (or hour).

like image 739
PhD Avatar asked Feb 10 '12 04:02

PhD


1 Answers

I can't think of a language that has a scalability limitation. A scalability limitation for a language would be something like:

Language X can't be used to write programs that require more than 1000 lines of code.

That sounds ridiculous, and it is.

The stigma that PHP applications don't scale well comes from the fact that many inexperienced programmers choose PHP for their web applications. This is because PHP is an easy language to learn, integrates extremely well with Apache, and is supported on nearly every host in the world.

Inexperienced programmers will often use bad practices when writing code. Given enough of these bad practices littered throughout the web, written in the inexperienced programmer's favorite language, it's easy to see why some people are averse to PHP.

There's also, probably, a "holier-than-thou" attitude that some programmers have toward PHP (again, because of its simplicity).

PHP scales just as well as any other language when page caching and best practices are taken into account. There are plenty of well-used PHP projects to prove it.

like image 170
ken Avatar answered Nov 19 '22 21:11

ken