• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why J2EE is not popular in web application development?

 
Sundar Ram
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Do you know any popular website written in J2EE?? Or using JSP/Servlets??

For eg. YouTube is written in Python. Similarly any popular site written using J2EE??

I always found either PhP OR Ruby OR python as a choice for highly popular web application. Is Java technology unsuitable for web application development?? Is there any performance issuses OR other demerits when compared over other technologies??

-Sundar
[ September 06, 2008: Message edited by: Bear Bibeault ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this topic for an explanation why many sites that are Java-based do not look like they are. Ebay is an example.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the E in J2EE stands for enterprise. I consider banks and insurance companies and the like to be 'enterprise' sites. Just because a site like youtube gets big, doesn't, in my mind, mean it is enterprise. Some of the sitest that get the biggest hits are just HTML, with not scripting at all.

With simple tasks, you use the simplest technology. As things get more complex, you go to enteprise technology.

I work with J2EE all the time, but my website is just Servlets and JSPs with a bit. I'm looking at adding in a little Hibernate, but that's more for learing purposes than anything.

-Cameron McKenzie
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm reincarnating an old post here...

I'm an enterprise coder for a living. I've also worked with both php in the past few years also to develop my own sites. I chose php due to the cheapness of external hosting available.

I also think it's faster but I have no real proof of this.

Of course there are many different ways of defining speed. "time per request" could be a case, comparing 2 functionaly identical efficient sites in php and a servlet based one.

Of course the underlying structure of the application would be different. But I want to keep maintainability out of the discussion.

I suppose I could conduct some basic tests, but there been any studies looking at the speed of web containers compared to a LAMP setup?
[ September 04, 2008: Message edited by: Eurig Jones ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure you can compare PHP and JEE. You possibly can compare PHP and JSP I suppose, but PHP doesn't come close to supporting all that JEE does.
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget the advantages of using either. I'm talking about specifically performance and nothing else.

You definetly can compare them in terms of performance. Identical pieces of simple funcionality can be created and stress tested with different server loads using jMeter or something like that. Examples:

- A servlet or jsp which prints something and a php page which does the same.
- A simple for loop using jstl in a jsp, java in a servlet and of course the equivalent in php
- Simple database access. Maybe comparing a simple query from a servlet with no persistence layer. The same from a php page.
- Other simple tasks. etc.

A good test suite attempted on several web containers all fronted by apache would provide accurate results to answer the question.
[ September 04, 2008: Message edited by: Eurig Jones ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with the advantages of one over the other. My point is how do you write the test case to compare the performance of (for example) JMS and PHP? Claiming "PHP performs better than JEE" is not something you can do.


A good test suite attempted on several web containers all fronted by apache would provide accurate results to answer the question.

Probably. Can you post your results when you get them?
[ September 04, 2008: Message edited by: Paul Sturrock ]
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose I could knock something up myself reasonably quickly!

Problem is at the moment I'm traveling in Asia and I only have 1 laptop! You'd need to multiple machines for this one. 1 with jMeter on it and the other with the stuff to test.

Yeah, I'll post the results here when I get round to it.
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are lies, damn lies and benchmarks. The fatal flaw with this whole concept is the idea that all apps are equal. They're not. Each app has its own requirements and its own minimal, typical, and worst-use cases, and they themselves are generally going to shift over time as resources, environments and external constraints are supplied. In some cases, PHP can be expected to produce better results, in some Java will, in some the winner may even be LISP.

One of the major benefits of Java is that in many cases you can swap in and out standardized components to obtain the most satisfactory results. I recently did just that. A small Maven change converted an OpenJPA project to a Hibernate JPA project and got me out of a lot of grief.

The major strength of PHP lies in its low initial coding overhead. You can knock together something in a day or 2 that would typically take closer to a week in J2EE, in large part because PHP is first and foremost a web framework, whereas in Java it's one of many platforms to configure for and in part because you don't have to lock down as many details in advance, due to the more dynamic nature of the language,

Conversely, however, as projects get bigger and more complicated, the extra startup costs for Java begin to pay off. The code is more constrained, so it's easier to bring in new people and have them understand it quicker. Because the language is less dynamic, if someone doesn't know or forgets minor details, chances are that it will trigger a build error rather than waiting until it's in production to blow. And, of course, PHP has had more security issues than Java - not everything is performance, you know. Especially in an era where it's easier to buy more hardware than more brainpower.
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. This is the kind of thing I was looking for. Here I found a study (actually part of a chapter from O'Reilly Tomcat: The Definitive Guide, Second Edition). Luckily the chapter is available as a sample chapter on the O'reilly site :-)

Sample Chapter 4

According to this and quite suprising to me really, is that Tomcat was actually found to be a tiny bit faster than Apache at serving static content.

Thanks for your reply Tim,

I fully realise that modularity, flexibility, maintainability etc. is key to designing an app. I'm not trying to here either to compare which is better to use on a small scale or large. But I want to forget about all of the other important things when choosing a platform and concentrate soley on performance. I'm not trying to compare developing with servlet or php. I'd like to know their performance at handling basic tasks.

They both designed to create html and serve. They both have the same goal. If you designed tests that are simple enough to replicate logicaly in both languages (again, forget about well thought out code) then I don't see why you can't compare their performance.

And, of course, PHP has had more security issues than Java - not everything is performance, you know. Especially in an era where it's easier to buy more hardware than more brainpower.


It doesn't matter if you have a large scale web app or a small one. the processor power per request is still going to be kind of the same. Therefore the percentage hardware cost of a small app compared to a large one is pretty much the same.

No matter how cheap hardware is I'd rather have 10 machines running than a 20 doing the same job!
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eurig Jones:
... I fully realise that modularity, flexibility, maintainability etc. is key to designing an app. I'm not trying to here either to compare which is better to use on a small scale or large. But I want to forget about all of the other important things when choosing a platform and concentrate soley on performance. I'm not trying to compare developing with servlet or php. I'd like to know their performance at handling basic tasks.


The basic problem people are talking about is what you are comparing. PHP -> JEE is meaningless, apples to oranges because they are NOT designed to do the same thing. Comparing PHP -> Servlets/JSP is a better comparison. But you will have to make sure you configure your settings properly to test real-world scenarios. It will be real easy to make a meaningless test if you make your JSP have to recompile each request, for example.

So when you do the tests just be careful what you are testing.

Originally posted by Eurig Jones:
They both designed to create html and serve. They both have the same goal. If you designed tests that are simple enough to replicate logicaly in both languages (again, forget about well thought out code) then I don't see why you can't compare their performance.



Again, not exactly. Take the Servlet/JSP subset, and you are closer to 2 technologies that perform similar tasks.

That said, I have a real problem with "forget about well thought out code". Who cares what platform serves bad code faster? What would be the point? The point is which makes it easier to build good code, to maintain good code, and provides the functionality you need. If you are going to do tests please take the time to make good code for both the PHP and JSP side.

I would spend a lot more time in testing a platform for its features rather than is speed. Only if the feature set was comparable would performance be a consideration (what is the point of a fast system if it doesn't do what you want?). Of course to do that you need a clear idea of what you feature-needs are.
[ September 05, 2008: Message edited by: Steve Luke ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35743
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eurig Jones:

They both designed to create html and serve. They both have the same goal. If you designed tests that are simple enough to replicate logicaly in both languages (again, forget about well thought out code) then I don't see why you can't compare their performance.

If all you are doing is creating HTML and serving it, you can compare the performance. It is crucial to note that the comparison is only valid for applications that JUST create HTML and serve it. In every application I've ever worked on, the database as been the bottleneck. Even on tiny applications. Which means that I really care which is faster overall. Not just in the HTML rendering layer. I do like that the chapter you quoted clearly states that it is comparing the performance of serving static content. Of course, you don't need either Java or PHP for static content - just a web server.

It doesn't matter if you have a large scale web app or a small one. the processor power per request is still going to be kind of the same. Therefore the percentage hardware cost of a small app compared to a large one is pretty much the same.

While the scale of the userbase may not matter can be abstracted by considering power per request, there is more to it than that. There is tremendous variation of complexity per request - often within the same application.

No matter how cheap hardware is I'd rather have 10 machines running than a 20 doing the same job!

Agreed. Which means tuning within the chosen platform remains important.
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Jeanne,

If all you are doing is creating HTML and serving it, you can compare the performance. It is crucial to note that the comparison is only valid for applications that JUST create HTML and serve it. In every application I've ever worked on, the database as been the bottleneck. Even on tiny applications. Which means that I really care which is faster overall. Not just in the HTML rendering layer. I do like that the chapter you quoted clearly states that it is comparing the performance of serving static content. Of course, you don't need either Java or PHP for static content - just a web server.


Of course it's crucial to see that this is only valid for static stuff. But it proves that Tomcat, a Java based web server / application container can par up to Apache Web server for static content.

Serving static content can be very important for some apps that are heavy on serving images and javascript etc. People I've worked with in the past (and me too!) seem to think that apache webserver was far quicker than Tomcat at serving static content.

While the scale of the userbase may not matter can be abstracted by considering power per request, there is more to it than that. There is tremendous variation of complexity per request - often within the same application.


I agree. But looking at testing simple web functions under different loads in both languages can certainly give you a somethoing.

There is tremendous variation of complexity per request as you said. But if you think that a good portion of the request time goes on stuff we don't really think about when designing an app like how much time it takes to process an EL expression, the execution of the underlying live servlet and the creation of it's HttpServletRequest and Response objects or how heavy/lightweight our chosen framework is on our requests.

Regards,
Eurig
[ September 06, 2008: Message edited by: Eurig Jones ]
 
arulk pillai
Author
Ranch Hand
Posts: 3402
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have worked on at least 12 projects for 8 different companies and used JEE in evey one of them. Even the most of the job advertisements in Sydney have JEE. If you use frameworks like Facelets, Tapestry, etc your files can be just XHTML. How do you just tell from the file extensions that a particular site is not using JEE.
[ September 06, 2008: Message edited by: arulk pillai ]
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erm... Can't see what this has to do with the above!

If you're using just simple servlets you can map a servlet to whatever.html if you want to! You don't have to use Facelets or Tapestry to hide the fact that you're using JEE.

Facelets use XHTML files but not like JSPs. They're not servlet based. It's a total replacement view technology for JSF. A much better one IMO too. The template engine is fantastic

I've not used them for a while.. But when you access say a mapping like /hello/page.faces, the container looks for an xhtml file /hello/page.xhtml. I THINK thats the out of the box way its set up as far as I can remember.

... That answer your question? :-/
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35743
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eurig,
I agree with most of what you said. And I agree you were talking about the proper context - static requests. Since the original poster was a bit more vague, I felt the need to state it again .

But if you think that a good portion of the request time goes on stuff we don't really think about when designing an app like how much time it takes to process an EL expression, the execution of the underlying live servlet and the creation of it's HttpServletRequest and Response objects or how heavy/lightweight our chosen framework is on our requests.

For requests not involving a database or much processing, I agree with that.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fail to see why this thread is under "performance"
I believe it belongs in a J2Ee or JSP or servlet section
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pat Farrell:
I believe it belongs in a J2Ee or JSP or servlet section

As Eurig Jones seems to be tunnel-visioned on performance aspects rather than other, even more important, aspects of platform choice, I'd say that this is the appropriate location.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That one poster is tunnel visioned and has hijacked the thread doesn't sound like a good reason to keep it here, IMHO. But I can just ignore it. This is a classic case of premature optimization. There are many more important things to worry about.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35743
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat,
The original post was somewhat related to performance too "Is there any performance issuses" so I think this is fine.
 
Ericson James
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was kind of just bringing the debate on weather it's possible to isolate and test performance. I didn't really want to be 'tunnel-visioned' back into the old debate that every developer and their mother has had on how to choose a plaform correctly.
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Performance can itself mean many things. It can mean end-user response time, backend transactions/second, amount of data moved/transformed/calculated per time unit, "TCO" (which itself has multiple definitions), ROI (likewise), and even Watts/transaction on a blade system.

A couple of years ago, someone "proved" that a Commodore 64 was faster than OS/2 on a state-of the art processor. He wrote a simple app in BASIC. The catch was that the app allocated an array so large it spilled out into virtual memory. Then he did random access in it, causing page faults for every element read/write. The system, of course, responded by going into page thrashing. And, if I know OS/2, crashed not long after.

People want simple answers, but life just stubbornly refuses to be anything near simple - hence Einstein's caveat on his "everything should be as simple as possible, but no simpler" quote. The real winners - and note that I categorically reject the simplistic "There Can Be Only One" assumption - depend on the job to be done, how the solution was designed and what the criteria for success is.

I've literally blown the doors off assembly language apps replacing them with Pascal and seen a program that could - and did - take down an IBM mainframe daily (no mean feat, taking down a mainframe) that was transformed from lions to pussycats by making a 1-line configuration change.

J2EE is a proven and reliable technology. It's used in a lot of places. It might be used in even more, but the general order of the day is "Git-R-Dun", and you can output visible (if less reliable) results faster on PHP, Django, RoR, VB.Net or similar late-binding platforms. Some projects really don't need to be scalable, secure or bulletproof, however, so that's fine as long as more robust solutions are applied where robustness is critical.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!