Java and tomcat vs ASP.NET and IIS - asp.net

Until recently I'd considered myself to be a pretty good web programmer (coming up for 10yrs commercial experience on a variety of e-commerce, static and enterprise applications). I'm self taught and have always used the Microsoft product stack (ASP, ASP.NET)...
My applications are always functional, relatively bug free, but have never been lightening quick. As a frequent web user I always found this to be the norm... how fast are the websites from the big tech players (eBay, Facebook, Microsoft, IBM, Dell, Telerik etc etc) - in truth none are particularly fast. I always attributed this to "the way things are with web apps"...
...then I cam across a product called Jira from atlasian and this has stopped me in my tracks...
This application is fast, and I mean blindingly fast.. too fast to time the switches between pages, fully live content, lots of images and data and cross references etc etc...
I run this on an intranet, with a large application DB, and this is running on a very normal server (single processor, SATA HDD, 8GB RAM).
Am I missing something?? Are my programming techniques that bad?? I am wondering if this speed gain is down to it being written in Java and running on Tomcat.
Does anyone have any benchmarks to compare JSP / ASP or Tomcat / IIS???
Thanks,
Mark
NOTE: this isn't a blatant plug for Jira. I don't work for them or have any affiliation to them... but I would like to be able to write applications like them :)

YMMV. But one of the longest-lived Things That Aren't True Anymore is the assertion that "Java Is Slow". Excepting floating-point (where most Java implementations aren't at liberty to use the floating-point hardware), Java is generally as fast or faster than compiled code. Some of the best and brightest have spent years of effort ensuring this, including such things as dynamic recompilation/re-optimization of code based on run-time metrics - something that statically-compiled languages like C or assembler cannot boast.
ASP is sort of the opposite extreme, since the original ASP had to recompile each page request each and every time it was made. ASPX addressed this by allowing retention of the compiled page code. That got rid of a lot of useless overhead.
A more compelling reason to prefer Java over ASPanything/IIS is freedom. A Java/Tomcat webapp will run under almost any OS on almost any hardware. IIS runs on Windows. Period. And for the most part, that also means Intel. Not Sparc, Not zSeries. Maybe you don't care. But then again, maybe next week IBM will offer your employer a can't-refuse deal on a mainframe.
I don't have benchmarks, and there are a lot of things that can make one platform preferable. But I permanently gave up on the "Java is slow" idea when I encountered the Poseidon UML tool with its cool real-time graphics UI and the FreeMind mindmapper tool. A small hit to startup the JVM, but after that, you'd never know what language you were working under.

The great debate. Java vs. .Net.
When .Net first came out there was an application written called "The Pet Shop." Which was a .Net port of Sun's J2EE reference application, "The Pet Store". It was announced that Microsoft's implementation was "faster."
As with anything, especially anything to do with marketing, you have to dig deeper to find the truth.
Any technology can be fast with enough hardware and the correct design.
In my experience there are two factors to speed: What type of hardware is used and how you architect your application (this includes database tuning).

Caching at various levels (response, db, etc.) makes a huge different in responsiveness of a web application. There is also a lot of things that are done to reduce time consuming operations like db connection pooling, sql statement caching, etc. As much as I'd like to say Java is better :-), I think in this case the performance is due to the way Jira was written and the fact that it's being run internally (probably with few users as compared to eBay, Facebook, Microsoft). This site, Stackoverflow, uses ASP.NET MVC and IIS and is very responsive and my guess (since code is not open sourced, yet) is that they use many of the same techniques you would find in Jira or any other web application built to scale.

I think that it is not typically the frameworks and languages used that make an application slow. In my experience, some frameworks like JSF or .NET server side controls give developers alot of freedom to make too many database calls and look things up too often, but that's definitely not the fault of the framework used.
Keep your application as light as possible and focus on keeping the data sent to the client as small as possible, and you will have a fast application. It's usually faster to develop fast applications too.
The Jira folks have written a best in class application (and charge for it) - nice work crocodile dundees.

I also suggest to consider also two aspects:
the maintenance activities: logging and deployment. In my opinion under a unix like server is more easier to log, deploy, and maintain new release than doing the same on a Windows server.
if the project require to use some open source application (i.e. Alfresco repository) Java is better solutions

People's opinion is mostly biased. Most people have never really tried the other while claiming the other is slower. I wouldn't trust any answer: it's mere opinion. It's boring to always read the same 4 cents again and again.

Related

Nodejs vs SignalR: why do we need server-side javascript?

Since I've known about Node.js, I've always been a fan of it. But today I found about SignalR, which provides an alternative asynchronous - scalable - realtime model for ASP.NET.
As far as I know, the main advantage of Node.js over SignalR is sharing code between client-server (another advantage should be that it is cross-platform), and the main advantage of SignalR is a much more mature framework and far better tool (IDE) support. So I wonder: if SignalR is here, do we need Node.js on Windows anymore? Are there any advantages of Node.js I don't know?
SignalR is a viable alternative to Socket.IO and Node.js. There are other reasons to use javascript on the server however.
It flattens the stack. Almost any website these days has to have javascript on the browser, and if you use it on the server as well, you can cut one language out of the batch that you'll have to be proficient in.
Message passing is very natural. JSON Everywhere! Especially combined with a document database which uses JSON, all message passing just becomes JSON objects. This makes reduces the amount of message brokering that has to happen throughout the system.
It's not Microsoft. I personally love what Microsoft has done for the development community. They make fantastic tools and one of the best frameworks and languages around. That being said, some people just love to hate Microsoft.
Cost. There are many good ways to get Microsoft tools for free or very cheap (Express editions and Biz Spark). There is still a higher cost associated with working with Microsoft tools. I believe this cost is worth the productivity gains in most instances, but not everyone agrees.
In addition to the above, there is still the story going around that you can't scale long polling requests on IIS due to the threading model. This has some truth to it, but with good code design, and some server tweaks, you can mostly get around these problems.

What about OpenEJB? Is it worth it? Any opinions?

I whould like to know some opinions about OpenEJB: we are considering to use it on a new project, but really didn't found many opinions about it.
So, here is my question: how about it? Does it perform well? Is it stable enough for a production environment?
We switched to OpenEJB (deployed embedded in our app on Tomcat). Performance tests showed better or not worse results processing our transactions compared to JBoss (transactions include data access, JMS, and servlets). We use ActiveMQ within OpenEJB for JMS. There are no stability problems as of yet - we are still in staging (pre-production) environment though. The documentation is definitely lacking, but not as poor as other embedded choices. Overall, we consider this as a good choice if you run on Tomcat. Deploying it on other application servers turned out to be much more difficult (JBoss, Weblogic, Websphere) but there are not many reasons for this usually (we had few but dropped this after several attempts basically failed).
And as in all open source products: expect lack of support (documentation, troubleshooting, bugs, etc.) to be compensated by free access to sources.
We've had experience with Oracle OAS and JBOSS before. We decided to give OpenEJB a try. We've found out that it is not only very fast but it also much easier to setup and configure, and it has much better defaults.
Currently we implement our own failure measures in the client, so we don't know how they compare for clustering, or other advanced features that we don't use.
We we have to go back and deal with JBOSS in the developer side, we see a drop on productivity, because it takes too long to bootstrap.

Development Effort: Web vs. App

what does the relation between a Web frontend and a smartphone App with identical feature sets look like regarding the development effort? Are there any specific differences regarding the development effort between Apps of different smartphone platforms (iOS, symbian OS, Android, etc.) ignoring training time? A general estimation would completely satisfy me. ;)
Thanks in advance,
Flinsch.
I hesitate to call this an estimate, or even an informed guess, but perhaps by putting down some ideas I might help your thinking.
Ignoring any particular platform specifics I see the fundamental difference of Web v Native is that in the Web case you have some extra work to do:
a). You have presentation separated from the backend, with probably HTTP in between. So there are services to write and issues concerned with notifications and/or polling to deal with.
b). You're likely using a browser to do the presentation so you will be using some JavaScript kind of library, and these are still hard to drive.
So, if you are targeting a single device my guess is that writing native code is likely to be 50% quicker than web-based code - assuming that you really are targetting identical function.
What seems to happend is that we compromise Web Apps, reducing functionality somewhat and hence the overhead is reduced.
Also there's another factor, the UI portions of the Web App are in principle portable, hence in fact the Web App development may be a reasonable investment even if it does take more effort.
I suspect that portability may well end up being a dominant consideration.
specific differences? There are plenty, but each with their own tradeoff:
UI: Web applications have CSS, (HTML, XHTML, HTML5) specifications that is supported by major browsers (although have have their issues). For Smartphone apps, each UI has to be designed and implemented according to the language the apps can be built on. You can effectively create apps like Winamp (having skins). For web applications, this is relatively a quick effort compared to writing UI's for each different smartphone OS models out there.
Language of use/Portability: In Web applications, an application sits in a server, so every request is sent to the server and response is returned from it. This allows that 1) Web applications can be written in any language of choice, as the end user never sees the server nor needs to configure it, 2) It allows the developer to write in a language that he/she is comfortable in. In smartphone apps, for the developer to run his apps to all the smartphone OS'es, he/she has to learn the programming language for the OS, and learn to port their code to work there (if porting is possible). That never exists in Web applications.
Hardware limitations: For smartapps, the developer must be aware of the cellphone capabilities and limitations. Facebook (e.g.) can essentially grow their memory, and add new servers and cluster their environment as the demand grows. You can't do that with smartphone apps. You will have to limit your implementation to run in a capability that your desired smartphone can accommodate.
There are more (feel free to add) but all these are part of the development effort that a software developer has to look at if they want to go a a field of choice.

Divorcing ASP.NET & SQL SERVER what alternative do you suggest? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have been developing in asp.net since its existence (also classic asp before that) and also I have been using SQL server as my back-end database.
After serious consideration, I now want to change the language I use. Considering the OOP capabilities of the .NET platform, what other languages do you suggest that I start learning instead of ASP.NET and why?
Also what should I use as a database? I have no experience in databases other than the SQL Server.
Django would get my vote.
Like you, I'd been using ASPNET since its creation and then a job forced me to use PHP. Then another. And another. I got to the point where 90% of my time was spent doing PHP and I didn't want to split my time between two completely different work-flows so I just went with it.
PHP, as you may or may not be aware, is a complete scrotum of a language when compared against the relative beauty of languages like C# or even VB.NET. And it's not getting better any way soon. Development frameworks mean you have to upload half-a-million files for each project and it all just feels unneccessary.
So about two months ago I started to look into alternatives. I use Linux now so I bump into Python quite a lot of the time. It looks pretty enough. It's always pretty well formatted (by design) and it has fairly excellent OOP techniques and opportunities.
Then I learnt about the Django ORM so I thought I'd make a quick site with some basic interactive features. I made a secret santa website for my girlfriend's family. Multiple forms, authentication, listing and detail pages and a splash of AJAX. Took me (a complete uber-novice) two days to get functional and the rest of the week to beautify (I'm a slow designer).
Other benefits include its superb built-in caching, a community that really knows how to program stuff, pre-made, reusable apps that you can just plug into your site and go, and python's easy_install and pip that make getting modules so simple. Oh and unlike ASPNET, it'll run on any OS which can make for considerable savings for personal projects.
I've since ported the rest of my PHP sites (and those that I have to maintain) to it and I'm about to start porting over my ASPNET projects. I'm happy.
Databases are pretty much a non-issue in Django. You pick one that's right for the size of your project, plug it in and the ORM handles all the DBIO.
I use SQLite for small-to-medium projects and a MySQL cluster for large projects.
I would use PostgresSQL for your database. It is by far the most feature complete of the open source databases. Though MySQL seems to be regarded as the best for speed. If cost is no object then oracle is obviously a big player.
In terms of language Java is going to be your best bet for similarity to the .Net languages. It is strictly typed and OO like C#. And is widely used in large enterprises, much like .NET.
Of course if you are changing just for the sake of change then maybe its better to switch to something more different. Ruby and Python are the big dynamic languages these days and will offer a different perspective.
Ruby on Rails seems to be very nice choice. Only it is a bit too different and bit too weird. But seems to be most effective, too. RoR is database agnostic, so the choice of database is not about syntax. You don't need to think about which database you use when writing application. You just use RoRs methods to access database and it will automatically wire it to the DB engine.
Or go with PHP and MySQL, it is proven and widely spread. I myself was using MS SQL Server first and switched to MySQL without problems. PHP is a bit dirty language, but it is comfortable to use and well supported and documented, too. If you decide to go this way, try ZEND framework, it solves lots of things and makes writing web applications much easier.
Use Mono, it runs on Linux, Mac and Windows. It runs my ASP.NET program faster in Ubuntu than when it is running on my development machine(Windows XP's IIS, though I haven't yet compared the speed when running on Windows server)
Languages supported on Mono: C#, Java, Boo, Nemerle, VB.NET, PythonNet, IronPython, Oberon, PHP, Object Pascal, Cobra, Component Pascal, Delta Forth, DotLisp, #Smalltalk
For database, use PostgreSQL, it is dubbed as the Oracle of the opensource database. It has many features suitable for enterprise-type system.
http://www.mono-project.com/Main_Page
Why not take a look at ASP.Net MVC, you will capitalize on much of what you already know and is quite a bit different in its approach to websites. Just switching without a compelling reason or target in mind is probably not that useful, however it doesn't hurt to learn another language.
This site is built on ASP.Net MVC and Linq to SQL.
What is the reason for you leaving the .net scene?
A change of language may not fix the root cause.
I switched from LAMP to .net myself due to my job and then gradually in my hobby time to allow me to focus 100% on 1 language.
I switched from LAMP to .net myself due to my job and then gradually in my hobby time to allow me to focus 100% on 1 language.
You probably learned a few things from LAMP that you could apply to .NET. That's the best reason to explore other languages and frameworks.
Dynamic scripting languages can save considerable development time: no compilation, weak typing, and flexibility.
Personally, I love the flexibility of php. There are no abstract, inflexible, complex web controls to learn. I have complete control of my widgets because I can change the underlying code.
I didn't know php is still like a scrabbled scripting language... I don't want to go back to the old times...
No I need the shift to be as smooth as possible. From what I read, it seems ruby is going to be the choise... although Django seems interesting.
To be perfectly honest, the more I discover and experience in JavaScript / jQuery and DOM the less I use asp.net controls and related garbage on my pages. I have reached to a point where I know use ASP.NET for my project's back-end (objects and data classes to send and retrieve data) and standard HTML forms and controls on the front side, using jQuery for DOM manipulation and communication (thorugh ajax) with the server.
Having come to this point in my development career, I thought it would be a good idea to learn a new language that is faster than asp.net, that is not dependent on windows, and that is easier to learn.
I can then buy a macbook and relax :)
SQL Server Express has worked fine for me. I've used a lot of different databases with c#, but only mysql and binary files in production.
ASP.NET isn't a language. It's a framework upon which you can build web sites and web applications.
the reason is not job-centric.
Recently I realised I had enough of
bits-of-pieces that keeps me stuck
with microsoft. e.g. I want to buy a
MacBook but I can't since I need IIS
and VS etc.. (I know I can use windows
on a mac but what's the point)
Are you tired of Microsoft in general or ASP.NET specifically? Or is there a Cult you want to join that requires MacBook ownership? Or are you interested in LAMP or Java development? Do you still want to do web applications or are you more interested in desktop or mobile applications?
As far as databases are concerned, the most obvious alternative would be MySQL. Other options would be PostgreSQL or SQL Lite
I am creating a project called MPDA. It is a simple Dll and application that creates files that act as databases. It is aimed at .NET developers that want to use a database that does NOT impact on system performance on the system it is hosted on. Has no webside dependencies. If you have FTP access you can host it. No install required client or webside. Works on ANY platform with a file hosting ability. On drawback is it is accessible from .NET only.

Best performance comparison website or resource for .Net Web Applications?

I am the .Net specialist in a consultancy with many difference flavors of developers using many different languages and frameworks. Because everyone is pretty much trying to push their own agendas with our different clients in terms of what technology to propose, I'm constantly finding myself in the classic arguments with them all about "why" .Net may be a better technology solution for a given clients requirements.
Often time here, the debate comes down to the issue of performance. Usually the areas that are argued about here consist of costs, maintainability, and performance. I have a hard time arguing about cost because in general open-source technologies are usually cheaper, and although and can usual put a good word in for .Net in terms of total cost of ownership (It seems to be pretty easy to convince people that .Net applications have relative low costs for maintainability if the application architecture has been thoughtfully designed), we will really only push .Net here if the client understands and is indifferent about the costs associated with Microsoft licensing. In terms of maintainability, like I mentioned before, the other developers here realize how much a difference it can make when an application is thoughtfully designed. I have had around 8 years of experience programming .Net solutions and I'm pretty confident in my ability to present to a client all the features and tool sets that .Net provides to give an application a long, and easy to maintain life span.
So again, what it usually boils down to is an argument over performance. Up until now, I have worked for companies that already used Microsoft development technologies to developer their applications so while I have discussed performance with others in the past I have never been a position where I have had to convince performance. My other co-workers are always boasting about these different website that they go to that show improved performance for open-source web applications. This all being said, what I would like to know from everybody here is where do you usually go to get your information about how may some .Net web applications have out performed other technologies?
Thanks in advance for the advice,
-Matt
I appreciate the detail, though I must say I forgot your question at the end. =)
Anyhow, this is something that has certainly been on my mind in the past. There is always a conflict on what technology is the best. We all know on each side you will find zealots, so it's quite difficult weeding out the facts. Professionally, I've seen successes/disasters on both sides of the fence.
For you, since you have a vested interest in .NET. I would showcase success stories, such as ... (insert whatever big name site you want) Facebook, SO, etc. I'd also find stories where things went wrong on the .NET side and pinpoint the reason. Like you said, it is often poor implementation. I don't know how many DailyWTF stories I've seen with ASP.NET sites behaving poorly but it gets traced back to 1) Poor design 2) Implementation 3) Coding.
Once you have a solid show case to justify the technology you can then of course talk about your own past experiences. You need to qualify yourself as being able to avoid the same pitfalls that your stories exposed.
.NET loses in performance against C/C++. In general, it will win over Python, Ruby, and PHP in baseline performance. The static typing tends translates into faster native code. (There are exceptions, such as Python's hand-tweaked set() performance being faster than HashSets in .NET)
The difference might come down to things like apache vs IIS (and their respective caching configurations), database architecture, etc. Features than can be misused or misunderstood (ViewStates and large GridViews, or using large numbers of hidden WebControls, for example)
Depending on what type of application you are building I've found that performance is rarely an issue. All the technologies out there can perform well enough.
When debating .net versus java/ruby/python etc I usually try to point out other benefits of .net.
There was this one time my boss asked me why .net instead of others? He wanted to know because he could get a PHP programmer for cheap. As part of the report we wrote a simple web application in 4 different languages and the .net app ran the fastest by far. After that we solidified behind .net. This was when .net was new so none of us really knew it well. We came from ASP, PHP, Coldfusion and Java backgrounds.
If you are looking for .Net performance stories you can listen to this dot net rocks show

Resources