Why most large-scale Web sites are not written in Java [Personal View]
In my previous post, I asked the question: Why most large-scale Web sites are not written in Java. That question triggered very active discussions in the comments to my post, as well as on TheServerSide, and more recently, on Artima.
The responses to this question varied from those who took it as an offense against Java, and replied that Java is used in large-scale web applications (and even gave specific names and references); and those who said that LAMP is probably a better choice because it is much simpler. I picked Mike O'Keefe response on Artima, which IMO provides a good answer to this question:
1. Some of the biggest sites are using LAMP since that's what was proven, reliable, and had market share and skilled programmers, when they were written. Take Lands End, one of the first e-commerce sites, written in perl, C, running on Oracle DB. Or Slashdot - perl. Still is, I think. Certainly Slashdot scales, given the "slashdot effect", when Slashdotters hit a linked site, which invariably falls over.
2. All of the sites in Shalom's list are what I would call "content management", not heavy on the business logic. I think Shalom understands this as web vs. financial. But the point here is, if you are serving up mostly static pages, without too much business logic, certainly those are different requirements than a "financials" type app. Take Flickr- photos, or YouTube - video, Digg - text messages, etc.3. In addition to point #1, it also is important to consider the skills of the person writing the app. If the folks who wrote e-bay, as legend has it, over a weekend with a few perl scripts, or Facebook (PHP), in a similarly short time I think, followed the usual procedure required for your basic business app, they'd still be hashing out the requirements ;) Additionally, while certainly there are tools to simplify this (Rational Application Developer, NetBeans, Eclipse, AppFuse), but I can guarantee the effort, including steep learning curve required to hack out a simple app in J2EE (or Spring, or Struts, etc), on top of learning Java, is considerably more than hacking together a few perl scripts (or, nowadays, Ruby/Rails). To put it another way, Bill Gates scraped together 50K and bought the rights to Q-DOS. It didn't matter that even then were much better OSs out there, like CP/M. Marketshare's the key. Time enough to rewrite and build on more solid ground like NT. What's important is to take the time to do that, this will be key for Facebook.
It was quite amusing to read that some thought that I was anti-Java myselfâș (Thanks to Guy Nirpaz, my colleague at GigaSpaces, for clearing that up).
Some felt that the question itself was misleading. Well, I think that they are probably right in saying so. Finding an accurate way to put such question is very challenging.
Others felt that this was some kind of a marketing spin.
What seemed to be common to a lot of the responses is that the Java community tends to be fairly protective and defensive at first to new ideas, and many in the community view them as a threat. By doing so, we are missing a great opportunity to learn from approaches taken in the LAMP world, which address similar problems faced by the JEE community. Clearly there must be interesting lessons we can learn from them.
We simply can't ignore the fact that the sites that I was referring too were able to deal with very large-scale requirements without Java, and be very successful.
Final Words
The final word on what should be the *right* application stack hasn't been spoken yet, and we are probably going to see more of that debate in the future.
The interesting question that remains open is whether the Java/JEE world and LAMP will converge, or continue a parallel evolution.
There are new emerging frameworks that try to bridge between the two worlds: Run PHP Web Applications on the Java Platform is a good example, and Caucho and Spring On Rails. There are plenty of other emerging frameworks that I haven't listed that try to address the same challenge. Is that going to lead to convergence? - I certainly hope so. IMO there is a good chance that such convergence will happen simply because the challenges that even a relatively simple site needs to deal with become more complex when you add scalability to the list of requirements. This makes the simplicity argument in the LAMP stack significantly weaker,and the value of Java more relevant. It is now up to the Java community to embrace the LAMP world and not treat it as a threat.

Hi
Overall, i think the main point is to use the most productive framework, keeping in mind, economics and timeframe for deliverables.
Why would you use a framework that need twice the amount of code to do trivial operations - without naming (java) - it can be very lengthy to write code for manipulating files. Python, Ruby or even PHP make life just easier.
Sun only realized in the past few years that they needed an IDE as good as Visual Studio, but in the meantime they were loosing their audience...
to be continued..
CH
Posted by:Charly | October 12, 2007 at 09:36 AM
Once again the dreaded "J2EE is hard" rears its head; or in this case the quote is along the lines of "...learning curve of j2ee...". Come on that is pure BS as I've said before. If one really thinks that you must use all of J2EE to build a web app, they should be fired.
I mentioned before that anyone can build a Java web app in the same fashion as a PHP, Perl, Python, ASP, etc. app. Learning JSP is no more difficult than learning any other language. For all intents, you could build a jsp-based app with minimal actual java skills. It wouldn't be pretty, but it could be done.
I personally have no problem with PHP or Perl or any other language, but to say that it is quicker to do it in one language or another just isn't true. It is quicker if you *know* that language. I can build a java app far quicker than I could in perl or even ruby, because I know java.
With regard to Charly's comment, you don't need a good IDE to do Java. I use JEdit or even Notepad++ and do just fine. Sun wanted an IDE to rival VS so they can promote using the whole J2EE stack and thus sell enterprise-class software, much like IBM does with RAD and WebSphere.
All things aside, good link bait :)
Posted by:Robert | October 13, 2007 at 08:04 AM
Why would you write digg or youtube in java. The needs of a business application & youtube are vastly different. If you are writing youtube you care less about having a transaction server, a workflow engine, a rule server, an esb, etc. These things are probably not all that important to you. However, if you are writing an accounting application for a bank ... they all become very important. Within the java space, you can either purchase or use an existing open source solution.
I haven't looked in years, however when I did I could not find a decent workflow engine for php that we could use. But there were quite a few good java ones (both commercial & open source). Our choices at the time were simple ... do we write our own workflow engine in php, do we use a java one and hack together a communication protocol, or do we just write the application in java. We wrote our stuff in java. If we didn't need any of this stuff ... we probably would have used php.
The concept of the mythical web framework that can be all things to all people is a joke. Just because the application ultimately has a browser based user interface, doesn't make them the same kind of application. Why would one framework exist to handle all use cases. The popular consumer websites are doing things that don't need the rich ecosystem of existing solutions that java provides (besides scalability) - so why bother with the extra cost of using java?
Posted by:anonymous coward | October 13, 2007 at 05:03 PM
Hello, i think the heavy configuration java world(as i like to call it) will eventually merge with the simplicity of convention based frameworks and tools, in fact it is already happening. think grails or jruby on rails these tools are emerging as the key development platforms for java in the future, having both the simplicty of frameworks such as rails and the enterprise capabilities of the JEE and J2EE platforms is where its at, of course some of these tools rely on spring and hibernate(grails), and some need to be proven with real world scenarios(jruby) i think spring, hibernate, struts, jsf and ejb3 by themselves are going to be slowly but surely falling back to these other more agile frameworks that hide the complexity of dealing directly with these tools. just my 2c.
Posted by:Roger | October 13, 2007 at 08:37 PM
I think it is better to set a criteria for what you call a 'large scale website' and then make judgements/comments accordingly.
Such a big topic.
Does large-scale mean a large number of visits? Often there's Akamai plus local load-balancing in place before you even hit the web technologies.
Does large-scale mean processing business logic?
Does large-scale mean lots and lots of integration? Possibly to legacy systems, web services, whatever.
It's a big topic before you get down to describing the technology stack on the server.
I've worked with C-CGI, Perl-CGI, PHP, Python, ASP, ASP.NET, and most flavours of J2EE presentation technologies. Plus Adobe Flex. I just can't make a huge general statement on what is best.
Team size, best practices, organization prescribed development methodologies, lots of variables. Various environments lend themselves better to the use of certain technologies. You can have have a great technology implemented poorly just as likely a cumbersome and difficult language, or technology, implemented well.
The topic reminds me of when I was in elementary school and kids were debating whether Bruce Lee or Chuck Norris would win a fist fight.
Posted by:Matt | October 14, 2007 at 02:20 PM
"What seemed to be common to a lot of the responses is that the Java community tends to be fairly protective and defensive at first to new ideas, and many in the community view them as a threat. By doing so, we are missing a great opportunity to learn from approaches taken in the LAMP world, which address similar problems faced by the JEE community. Clearly there must be interesting lessons we can learn from them."
I disagree. Your previous post seem to conveniently left among the biggest Java implementations in the wild. (Google and Amazon come to mind. Oh, EBay too.)
What the post basically did, was stating something you found on the web for what it is, without clear arguments and discussion in the article itself on why you think it is so (and providing good examples at that).
You can expect any post of that kind to receive a lot of arguments.
Added to the fact that the title itself concluded something, without good backups on facts and statistics, you are basically inviting arguments.
It would be nice to have an article that provides something clearly, with good argument so, in a clearly structured way.
Posted by:Fadzlan | October 24, 2007 at 01:06 AM
I should say I have more or less the same questions too, myself! In Greece - where I come from - J2EE support from the ISP is so lousy that it is a reason in its own right. However, I believe there are some other, more objective ones.
1. Getting to install LAMP in a testing environment is a fairly easy job. Same goes for Linux and Windows machines. Heck, in Linux machines it is already pre-installed with the distro.
2. Java is a programming language! Don't get me wrong, PHP is one too, but it proves to be easier to "render". Java needs to be compiled. An application server needs to be installed along with a JVM and errors are shown in log files. That is complex for most people.
3. J2EE has many ways of being written. It can be scripted (JSP, EL, Taglibs) or compiled (Servlets). PHP is more straightforward. You write code and you see result (that is a bit oversimplified, but for the small-scale sites it is true and that is where Java lacks in popularity).
All the above are not at all things that can be used in a debate of whether to use Java or PHP (or Ruby, etc.). They are not arguments that state which technology is better and for what purpose. But, they show a lot about what many people need and how they choose it...
Posted by:Takis Bouyouris | January 24, 2008 at 05:59 PM