As what my reading goes about this query is when to use LAMP and when J2EE?? For this, many of the Gurus suggested that for mid/small size projects, the best option available is LAMP over J2EE and for bigger enterprise applications, go for J2EE.
First a few thoughts on what it really means, when a project scales from being a mid sized one to a large project. Things that would typically have changed post deployment are: 1. Number of users would have increased 2. Number of transactions would have increased 3. Scope (changes in business logic as well as many additions of components and functionality) 4. ??? Am I missing anything?
Number 1 and 2 would typically have to be dealt with by upgrading hardware of the machine(s) hosting the Application Server and the Database Server. Starting with RAM, perhaps the CPU and then eventully putting into place a clustered solution. I am not very certain to what extent the choice of LAMP vs J2EE would effect this, except that the machine(s) hosting the J2EE App Server will require greater resources. However if we were to deploy the application over a cluster of servers as the application scaled up, then I hava heard that J2EE App Servers lend greater stability as opposed to a LAMP solution. This is something that I have read, but do not have any practical experience. So please correct if it's worng.
As for number 3. All applications will have post deployment enhancements As an application undergoes these changes, it should still be understandable/maintenable as well as robust. Also effort of making these changes should be as low as possible. This sort of scalability is achieved by a good architecture more than anything else. J2EE enforces certain standards and proposes a blueprint for application developers. If these standards are followed properly, the application becomes more understandabe and maintenable. Also many people find it easier to understand code written in a strongly typed language (Java/C++) than a weakly typed language (PHP), especially when dealing with a large code base. Offcourse a badly coded J2EE app would be just as hard to maintain. However the existence of standards and a J2EE blueprint would support writing better code. There are a lot of infrastructure level components that go into making a large application. Things like database pooling, MVC libraries, templating mechanism, authentication and authorization, persistence, etc, etc. Some of these are taken care of by the J2EE application server, hence making the application portable accross App Servers, and reducing the programmers effort in having to either build them or integrate 3rd party components. These are some factors favouring J2EE. I have been given to understand that LAMP on the other hand has a smaller learning curve and one can build applications far quicker than if they were to use J2EE. However these factors can often be overridden by by purely non-technical reasons, as Shuvam mentioned in an earlier mail. Sorry for the rather long mail.