I had a discussion with a friend yesterday about a Web site we're going to build. I have to plan for the possibility that at some point in the future, the site will have millions of page views per day, many of them from interactions. The nature of the interactions is such that I don't think we need an application server (e.g. EJBs), but will use a 2-tiered architecture connecting a Web server-based front end to a database. The Web server will be Apache and the database MySQL, but the question raised was "what to use for the scripting language?"
I've used JSP's in numerous projects and like the way you can use servlets as controllers to manage business logic and keep it seperate from the presentation logic. In the past, I've used PERL extensively. Lately, I've been hearing the siren song of Python. My friend was ademant: "If you want my help, it will be PHP. I simply won't use anything else." Now, I admit a bias: I've never written a PHP application from the ground up, but have modified numerous PHP pages and found that the business logic and presentation were all jumbled together. I didn't like it. So, I've been asking myself, is this merely an unfounded bias, or is PHP really just for small Web applications and bigger sites should look elsewhere? Here are some of my questions:
- First, can you effectively seperate business and presentation logic?
- Can it scale to multiple servers, millions of page views per day, etc.
- Are there frameworks, like Turbine, that provide connection pooling and other services.
- What big Web sites are written in PHP?
- What concerns are there in using PHP for large-scale Web sites? Anything you should do at the first to ensure that things work out later?
I'll start a discussion topic on the Ask Phil forum. If you've got some answers for me, please post them there.