The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

PHP+mysql  vs Java+postgresql/oracle

Hi all,
  I am working on a small app that will be used internally by the startup I work for. It consists of about 50 tables in the (mysql) database, and I am using PHP to provide a web interface for the application.

  For what I am doing, I think this is fine as the app will never be used by very many people at any given time, and  I don't expect more than a few thousand records in any given table.

My question is, how scalable is PHP+Mysql vs a more
traditional Java + PostgreSQL or Oracle type of application.

At what point would this kind of approach breakdown?
Ie 100s of concurrent users, 1000s etc?

bananarunt Send private email
Thursday, January 26, 2006
Scalability isn't about the tools. It is mostly about the application architecture. You can build a highly scalable applicaion using Java+PostgreSQL and you can build a highly scalable application using PHP+MySQL. But you can also build complete dogs with both sets of tools.

So did you create the application with scalability in mind or not?
Thursday, January 26, 2006
Once you get past 100 concurrent users (or so), the hardware also makes a difference. That old Pentium II computer with 64 MB of RAM, will start to chug.

As anon said, there are just too many variables involved.

When evaluating frameworks like LAMP, the real questions are:

1) How easy is it for you to maintain, i.e., recode.

2) How easy is it for you to move the application to a new machine, i.e., can you export/import your files, do you rely on lots of third party libraries, do you need to compile anything by hand?
Thursday, January 26, 2006
Thanks for the responses!

The database design is very flexible, and can easily scale.  The front end of the app I did not design explicitly with scalability in mind.  While the presentation and logic layers are separate, at most this app will be used by 10 people or less at any given time.

While this is a small App, I was primarily curious as to what others thought of PHP and scalability and what other's experiences are.
bananarunt Send private email
Thursday, January 26, 2006
I host an application written in PHP/MySQL that has hundreds of concurrent users (at peak times, it has 200 to 300 simulateous users). Each page view generates 15 to 25 database queries.

Last year, performance started degrading.

When I investigated the problem, I discovered a few database tables that weren't indexed properly, so I reindexed them.

I also installed a PHP compiled-code-caching extension ( ). And that helped quite a bit too.

But the thing that helped the most is that I combed through the application and moved a TON of functionality into cron scripts:

* Deleting expired sessions from the sessions table.

* Locking forum threads after a certain number of posts, or a certain period of inactivity.

Etc, etc.

There was a lot of functionality being needlessly executed on every single page. And I moved most of it out to cron scripts, which I execute once each minute or once every ten minutes or whatever, depending on the task.

More than anything else, that's what made my application really really fast.

Now, I'm confident that I could scale to more than a thousand concurrent users without suffering any performance problems.
BenjiSmith Send private email
Thursday, January 26, 2006
First, Benji has some excellent suggestions, worth considering as you more forward in development.

As to the OP, I do infrastructure/application design on a regular basis and given the complete hardware and performance profile, I can get close. 

However, I would suggest a simpler approach for you. Download Jmeter, write some "typical" scripts and hammer at the application until it dies.  YES - it is brute force, but it will answer the question.  Better, as you implement Benji's suggestions you will be able to remeasure and see the affect.
Thursday, January 26, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz