473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

PHP compared to Java/J2EE

Hi,

I'm wondering if I can get a reasonably civil (without starting any
huge wars) opinion on how server-side PHP compares to server-side
Java.

I've been strictly a Java developer for almost 10 years now, and I'm
pretty happy with it. However, I can't help but notice that there are
a significant amount of PHP-based development projects where I live,
and I've also noticed when searching around the internet for ready-
made web applications that a lot of them are in PHP.

As an object-oriented programmer I've always assumed PHP was more of a
scripting language for doing things on individual web pages or writing
small applications and that Java/J2EE was better positioned for
writing large applications, but maybe that's no longer true.

Let me know what you think. Thanks.

Frank

Nov 14 '07
66 4595
Sanders Kaufman wrote:
"Roedy Green" <se*********@mindprod.com.invalidwrote in message
news:g5********************************@4ax.com...
>PHP is for small projects, maybe at most a forum.. J2EE is for giant
ones.

And yet - PHP is *constantly* used for large, successful projects - while
Java sites are pretty much limited to pretty pinball games and such.
I disagree, I know large sites that are written in Java. As a mater of
fact, the company I work for (a *huge* internet presence) is largely a
Java shop. Some of our child properties use PHP, but they run into
scalability problems more often than the Java shops.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Nov 16 '07 #51
Mark Space wrote:
Jerry Stuckle wrote:
>database and request were identical in both cases. This was using DB2.

And yet, I was asking about your problems with JDBC with Linux and
MySQL......
I didn't specify Linux and MySQL.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Nov 16 '07 #52
Jerry Stuckle wrote:
Mark Space wrote:
>Jerry Stuckle wrote:
>>database and request were identical in both cases. This was using DB2.

And yet, I was asking about your problems with JDBC with Linux and
MySQL......

I didn't specify Linux and MySQL.
OK, NC did. You just specified JDBC, which is assumed to be written
largely in bytecodes.

Should I be able to reproduce this on smaller tables? Say, less than 1
million rows and less than 5 joins? Or does the problem only happen
with larger DBs?
Nov 16 '07 #53
Lew
Jerry Stuckle wrote:
comes to large systems. And Java typically requires more CPU cycles to
do the same job than a compiled language does (again, if both are
optimized).
That's just not true. I have shown you many links explaining otherwise;
you've provided absolutely no evidence for your assertions. Are you following
the Big Lie principle - repeat a big lie often enough and people will start to
believe it?

--
Lew
Nov 17 '07 #54
Mark Space wrote:
Jerry Stuckle wrote:
>Mark Space wrote:
>>Jerry Stuckle wrote:

database and request were identical in both cases. This was using DB2.

And yet, I was asking about your problems with JDBC with Linux and
MySQL......

I didn't specify Linux and MySQL.

OK, NC did. You just specified JDBC, which is assumed to be written
largely in bytecodes.

Should I be able to reproduce this on smaller tables? Say, less than 1
million rows and less than 5 joins? Or does the problem only happen
with larger DBs?
Makes no difference the number tables, size, etc. Once it gets to the
database (where all that work is done), the language is immaterial.

It does, however, depend on the number of rows actually retrived.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Nov 17 '07 #55
Lew wrote:
Jerry Stuckle wrote:
>comes to large systems. And Java typically requires more CPU cycles
to do the same job than a compiled language does (again, if both are
optimized).

That's just not true. I have shown you many links explaining otherwise;
you've provided absolutely no evidence for your assertions. Are you
following the Big Lie principle - repeat a big lie often enough and
people will start to believe it?
Nope. And I haven't seen any unbiased "proof" in any of your links.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Nov 17 '07 #56
Lew
Jerry Stuckle wrote:
Lew wrote:
>Jerry Stuckle wrote:
>>comes to large systems. And Java typically requires more CPU cycles
to do the same job than a compiled language does (again, if both are
optimized).

That's just not true. I have shown you many links explaining
otherwise; you've provided absolutely no evidence for your
assertions. Are you following the Big Lie principle - repeat a big
lie often enough and people will start to believe it?

Nope. And I haven't seen any unbiased "proof" in any of your links.
So even the article that favored C++ you regard as biased, eh?

And what is your evidence that these articles were biased? All they did was
report facts.

I hear rhetoric from you, but no evidence. At least I dug up objective results.

You have grown tiresome.

--
Lew
Nov 17 '07 #57
Lew wrote:
Jerry Stuckle wrote:
>Lew wrote:
>>Jerry Stuckle wrote:
comes to large systems. And Java typically requires more CPU cycles
to do the same job than a compiled language does (again, if both are
optimized).

That's just not true. I have shown you many links explaining
otherwise; you've provided absolutely no evidence for your
assertions. Are you following the Big Lie principle - repeat a big
lie often enough and people will start to believe it?

Nope. And I haven't seen any unbiased "proof" in any of your links.

So even the article that favored C++ you regard as biased, eh?

And what is your evidence that these articles were biased? All they did
was report facts.

I hear rhetoric from you, but no evidence. At least I dug up objective
results.

You have grown tiresome.
Spoken like a true evangelist. My product is better, no matter what
anyone says.

And no, I don't place any trust in any of them because they didn't lay
out detailed conditions for the test. There is not enough information
in any of them to determine how valid the test was.

You have long ago become tiresome. But I still tried to carry on an
intelligent conversation with you. I see now that is impossible.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Nov 17 '07 #58
Jerry Stuckle wrote:
>
Makes no difference the number tables, size, etc. Once it gets to the
database (where all that work is done), the language is immaterial.

It does, however, depend on the number of rows actually retrived.
Thanks. I'm going to be at a point in a couple of months to do some
performance testing, and I had already decided to check out both PHP and
J2EE. This will help me focus the tests a little more.
Nov 17 '07 #59
"Lew" <le*@lewscanon.comwrote in message
news:BJ******************************@comcast.com. ..
Sanders Kaufman wrote:
>>And yet - PHP is *constantly* used for large, successful projects -
while
Java sites are pretty much limited to pretty pinball games and such.

Nearly every agency in the U.S. Federal government uses Java for their
enterprise servers.
I was just being smarmy.
(Couldn't you tell by the tone of my voice and the expression on my face?)

Java is really no better or worse than any other language.

Nov 17 '07 #60
NC wrote:
Last September, Rasmus Lerdorf, the creator of PHP, gave a keynote
In 2006, not really last September, but the September before last. A
minor point...
speech at the php|works conference in Toronto. During his
presentation, he demonstrated several performance-tuning techniques
that increased an application's performance from 17 requests per
second to 1,100:
I didn't see any optimizations or code there. Did I miss them? It's
just an article saying that he did. No info at all...
Nov 18 '07 #61
Roedy Green wrote:
On Fri, 16 Nov 2007 08:22:25 GMT, "Sanders Kaufman"
<bu***@kaufman.netwrote, quoted or indirectly quoted someone who
said :
>And yet - PHP is *constantly* used for large, successful projects - while
Java sites are pretty much limited to pretty pinball games and such.

The company I do most of my consulting for makes the bulk of its
living rewriting apps in Java that have become too large for PHP, such
that every bug fixed seems to create two more.
However, are you sure that a similarly skilled redesign and rewrite in
PHP would not have done as well?

Patricia
Nov 18 '07 #62
NC
On Nov 18, 11:25 am, Mark Space <marksp...@sbc.global.netwrote:
NC wrote:
Last September, Rasmus Lerdorf, the creator of PHP, gave a keynote

In 2006, not really last September, but the September before last.
Indeed. My apologies for the mistake.
speech at the php|works conference in Toronto. During his
presentation, he demonstrated several performance-tuning
techniques that increased an application's performance from
17 requests per second to 1,100:

I didn't see any optimizations or code there.
But that's the point. No coding was required. Performance
improvement was achieved purely by means of system administration
(installing an opcode cache and changing MySQL configuration
settings). So every time I see a performance test, I wonder which
optimizations testers chose not to use or didn't know of...

Cheers,
NC
Nov 19 '07 #63
Lew
NC wrote:
But that's the point. No coding was required. Performance
improvement was achieved purely by means of system administration
(installing an opcode cache and changing MySQL configuration
settings). So every time I see a performance test, I wonder which
optimizations testers chose not to use or didn't know of...
Optimization is always both situational and non-transferable. The best one
can do is create a benchmark that is reasonably representative and is duplicable.

Ececution speed is also not the only, or even usually the most important
consideration. By far the largest cost of most software is not when it's
running, but when it's not (or not correctly at least).

Once performance gets in the ballpark, in other words, once with appropriate
effort you can get Java or PHP or C++ or C# or whatever to run with
approximately equal efficiency, the ability to manage team projects, create
all desired features and minimize risk will be the dominant factor in platform
selection. Development and maintenance costs will trump execution costs.

Benchmarks have shown that Java, C# and C++ are all in about the same ballpark
with respect to performance for most applications where these platforms are
considered. Strongly-typed languages like those three tend to win in the
choice of platforms for managed projects because of the robust API libraries,
language support for risk mitigation and feature support for concurrent
programs and other common requirements. The availability of trained
programmers factors in as well.

The best benchmarks will simulate typical work loads for a host under explicit
conditions. None will ever be perfect, because the real world is not
committed to working the way benchmarks do. At some point one has to assert
that the platform is fast enough, and look for other criteria to choose the
right one.

--
Lew
Nov 19 '07 #64
Rik Wasmus wrote:
On Fri, 16 Nov 2007 20:57:11 +0100, Mark Space
<ma*******@sbc.global.netwrote:
>Erwin Moller wrote:
>>I have written big stable mission critical applications running in
serious companies, with only PHP/Postgresql. They still run and
perform greatly up to today.

Just curious: You mean Apache/PHP/Postgresql, right? Because I've
never heard of anyone writing just PHP by itself.

Well, it could be done. Not really a standard though, and hardly advisable.
Hi,

There was a webserver involved in the projects.
In two cases even IIS, not excactly what I would advise, but well, I am
not the boss.

Sorry for the confusion.

Regards,
Erwin Moller
Nov 19 '07 #65
NC
On Nov 18, 10:10 pm, Lew <l...@lewscanon.comwrote:
>
Optimization is always both situational and non-transferable.
Situational, definitely. Non-transferable, I am not sure I agree.
For example, deploying PHP as a CGI executable is always a losing
proposition compared to either HTTP server module or FastCGI. The
choice between HTTP server module and FastCGI usually depends on the
HTTP server and the operating system. On BSD, regardless of the HTTP
server, FastCGI usually works better (that's the setup Yahoo! uses).
With Zeus, regardless of the OS, developers also recommend FastCGI.
The Linux/Apache crowd is unevenly split, with majority preferring the
Apache module and a sizable minority (including folks at GoDaddy)
leaning towards FastCGI.
Once performance gets in the ballpark, in other words, once
with appropriate effort you can get Java or PHP or C++ or C#
or whatever to run with approximately equal efficiency, the
ability to manage team projects, create all desired features
and minimize risk will be the dominant factor in platform
selection. Development and maintenance costs will trump
execution costs.
For small-scale applications, almost always. For large-scale
applications, almost never. In 2006, Google's R&D costs were $1.2
billion, while its purchases of long-lived assets (mostly computer
equipment and buildings housing it) amounted to $1.9 billion:

http://www.sec.gov/Archives/edgar/da...44494/d10k.htm

And that's Google, running its production systems on a proprietary
Linux-based software stack. Were we talking about a company whose
production systems run on an out-of-the-box commercial stack
(WebSphere/Oracle or Windows/SQL Server), R&D costs would be lower (no
in-house development of kernel and file system) and purchases of long-
lived assets, higher (licenses for commercial software running on
numerous production servers).
At some point one has to assert that the platform is fast enough,
and look for other criteria to choose the right one.
Indeed. And one of these factors just happens to be licensing cost.
And that's where PHP (and, I might add, Python) shine, as they can be
deployed on an open-source software stack.

Cheers,
NC
Nov 21 '07 #66
Lew
Lew wrote:
>At some point one has to assert that the platform is fast enough,
and look for other criteria to choose the right one.
NC wrote:
Indeed. And one of these factors just happens to be licensing cost.
And that's where PHP (and, I might add, Python) shine, as they can be
deployed on an open-source software stack.
Many Java-based systems, including one of the benchmark leaders now for Java
EE server apps, have the same licensing cost as you describe for the PHP /
Python case. They can also integrate Python in the mix, should one so desire.

--
Lew
Nov 21 '07 #67

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sig | last post by:
Hi there, Could you help me finding out whether Zope could be a serious technological framework for big corporation (compared to J2EE and ..Net) or not ? In the (quite very) big corporation I...
21
by: asj | last post by:
well, at least for the forseeable future, it looks like. i've always thought mauricio aguilar was a loony for continuing to post these job stats, when we all know C#/.NET jobs HAVE to go up...
2
by: radhikarohatgi | last post by:
Currently, to fuel our growth we are actively looking for professionals in Java/J2EE technologies with 2-7 yrs of experience for our Noida Center of Excellence. I would like you to go through...
1
by: bijay | last post by:
Hi, For Java , J2EE UML Interview FAQ and Certification Resources Please try. http://javainterview.tripod.com AND http://java.schoolreference.com
0
by: crystal | last post by:
Crystal Concepts offering PHP-MYSQL & JAVA/J2EE courses on short term basis. For details contact, 19/2 New No 182 Kaliamman Koil Street, Virugambakkam Chennai 600 092 mail: crystalcss@gmail.com...
0
by: praveen2gupta | last post by:
Hi, Java Char Datatype supports unicode. The Unicode supports 650 Human Languages. I would like to know How to use This feature while developing the Java/J2EE/JSP web based software product.
1
by: willimm | last post by:
I have a java/j2EE Position open in Westchester NY. Thought i would share this with you guys. Full time perm position hit me up willimm@gmail.com Mac
0
by: Giri | last post by:
We also have PE, SSE, SSE QA, SE QA, SSE-SCM positions *Please send the resume to girish_mc@intuit.com* 1) PE - Minimum 9 years experience - Must have extensive...
2
by: cppcompiler1000 | last post by:
sir, after c and c++ , i wanna do java and j2ee or .net . please tell me whether i should java/j2ee or .net for the job purpose. give me some conclusion and difference between these languages....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.