Hi Michael/ Skunks,
 Again allow me to disagree with your statement below:

> Said in another way: Java scales best on one server - but once you reach the limit of whatever that application is able to do on that one server, you most likely > have to rebuild large part of your application to make it scale even higher.

With Java or should I say a good J2EE app server you can develop you app and deploy it to multiple instances of your app server. These instances are managed by an admin server and you can use a proxy server to route requests with whatever algorithm you prefer. So in essence what we are saying is that to improve perfomance of application X just deploy it on more instance of the app server whether running on the same host or on a different host. That I think is pretty good scaling whether on a single server or on multiple servers.

Again its possible we are saying the same thing ;-)

KR,
Loki
 
"Excellent people exceed expectations".



From: Michael Pedersen <sku@kaal.dk>
To: Skunkworks forum <skunkworks@lists.my.co.ke>
Sent: Thursday, September 3, 2009 12:24:03 PM
Subject: Re: [Skunkworks] PHP vs Servlets/JSP

Hi Nicholas & other Skunks,

We are saying the same thing ;-)
You just explained the difference between the stateless and statefull models.

I agree with you that Java on a J2EE server has the potential to scale better than a "normal" PHP application when restricted to one server - however the way you have to code the java app in order to achieve this, is usually the exact techniques that prevent that Java app from using the power of multiple servers.

Said in another way: Java scales best on one server - but once you reach the limit of whatever that application is able to do on that one server, you most likely have to rebuild large part of your application to make it scale even higher. (and it is not as if PHP does not scale on one server - it does, just not as good as java)

When you then factor in the cost of application development & testing with the ever falling price of hardware, everything is in favor of being able to utilize multiple servers.
Prime example is Google - there datacenters are build with the equipment that gives the most processing-power/dollar i.e. many many "normal" servers instead of one "big" one.



Finally you _can_ code PHP in a statefull way - if you use e.g. memcache (its just not the default way) - the end result is that the way you structure your application can be exactly the same as when building a J2EE application - and if you really want then you can also code a java application in a stateless way (but there is little point in doing this).

All in all - I would say that if you use Java or PHP (or something else) - it does not matter - let personal preference rule depending of the nature of the project naturally.

Regards
Michael



Nicholas Loki wrote:
> Hi Michael,
>  I agree with you on two points. First that PHP can scale well across multiple servers and secondly that bad design/ engineering can ruin any chance of an application scaling whether it be developed in Java or PHP. I think scaling in this case has to be defined and metrics put in place for it to make sense. On a single server with high processing power PHP fails in scaling by virtue of the fact that it runs as an add on module on a Web Servers. JSP/Servlets on the other will run in a Web Container or J2EE server which in turn runs in a JVM. With increased processing power on a single server you can increase the instances of your Web Container/ J2EE server to scale the system. Again scalability has to be defined and metrics put in place for it to make sense. I still think that Java scales better than PHP even on a single server.
>
> KR,
> Loki
>  "Excellent people exceed expectations".
>
>
> ------------------------------------------------------------------------
> *From:* Michael Pedersen <sku@kaal.dk>
> *To:* Skunkworks forum <skunkworks@lists.my.co.ke>
> *Sent:* Wednesday, September 2, 2009 11:22:50 AM
> *Subject:* Re: [Skunkworks] PHP vs Servlets/JSP
>
> Hi Skunks and Nicholas,
>
> I highly disagree with you that PHP does not scale as well as JSP/Servlets - I will even go as far as to say that it scales better.
> That PHP does not scale / is enterprise ready is an old myth, one that most likely is a result of the fact that very few PHP applications are engineered with scalability in mind, or is just of poor engineering quality.
> Prime examples of PHP applications that scale very very well are Wikipedia & Facebook.
>
> The main difference is that PHP is stateless and JSP/Servlets is statefull. This leads to the fact that PHP applications (usually) is very easy to scale across multiple servers (i.e. scale very high) whereas JSP/Servlets (usually) is able to scale better when running on a single server - but often have a hard time running on multiple servers without considerable extra engineering.
>
> however bad design/engineering can ruin any chance of an application scaling - both with Java & PHP.
>
> Regards
> Michael Pedersen
> PLUSPEOPLE
>
>
>
> Nicholas Loki wrote:
> > Hi Skunks,  Allow me to disagree with what comrade Saidi mentioned about over-engineering. I think in any enterprise system design a high degree of over-engineering is expected. Personally I would go with start simple but make sure your simple anticipates and expects features that may come up in later releases.  About the language of choice, if you want fast turn around times for your development cycles together with ease of use PHP is the way to go. Though I still think it doesn't scale well under increased load. JSPs/Servlets scale very well under load, but are more complex to develop and maintain. Either way you need skills to achieve productivity with both approaches.
> >
> > Another way to look at it is, you could use a hybrid approach and have PHP for the front end and JSP/Servlets for business logic etc in the back end. You could then use REST APIs or WebServices to pass messages back and forth within the architecture. A bit of an overkill, but might be the way to go with really high volume systems.
> > KR,
> > Loki
> >

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
Other services @ http://my.co.ke
Other lists
-------------
Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce
Science:  http://lists.my.co.ke/cgi-bin/mailman/listinfo/science
kazi:    http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general