This is Argyn's blog. I comment on topics of my interests such as software, math, finance, and music. Also, I write about local events in Northern Virginia, USA and all things related to Kazakhstan

Wednesday, June 14, 2006


I went to AJAX presentation by Eric Pascarello yesterday in NOVAJUG. It was not bad. I learnt a few things about Javascript development in general and AJAX. Eric wrote a book called AJAC in Action, which he claims is the bestseller in Amazon.

While I was listening to Eric, I was bemused by the ugliness of Javascript code in AJAX. I believe that Javascript is ugly even when compared to straight HTML and JSP. So, I started to think about this: why would a corporate developer start using AJAX in Intranet applications?

The problem is not just the ugliness of JS. The AJAX technology brings so many issues, many of which were mentioned by the topic presenter. For example, take browser incompatibility. In general, since it's a much more sophisticated development methodology, AJAX should be more difficult to support than straight JSP. Thinking along this line, I came to an observation: maybe AJAX doesn't make any sense for Intranet. The reason is that ratio of users per developers is too low.

Let me tell you the story. some 10 years ago I was working for a tobacco company. They had more than two thousand workers. I had to write them a attendance tracking application. I called it Stone. Some 50 shift leaders would logon to stone at the end of their shift and enter attendance records of their workers. So, we'd have approximately 2,000*30 = 600,000 records per month. At the end of the month, the planning department would run a set of reports on this data to calculate KPIs for upper management.

At that time our standard tools were MS Access and MS VisualBasic programming language. It took me a few weeks to write the whole application, which had been in production for almost 10 years. Somehow, despite being a desktop database, MS Access was holding the load when used over the network. Ok, I did a few tricks, but the main reason was not my mastery of Microsoft development :) The reason was that this application didn't really have much of a load! Think of this: shift leader logs on to the system only once a day, then the factory works in 3 shifts. Hence, the coliisions are rare, locking is not an issue. Now, the monthly report run is a heavy operation, but it was done once the month is closed and application is locked for other users. So, the total number of transactions entered is ~2,000 per day per developer.

Now, if we think about anoter extreme: something like Google mail or Yahoo mail. I don't know how many users they have. Suppose, it's 10,000,000. Let's assume that in average they will check e-mail boxes twice a day, recieve or send 2 e-mails. This will bring us to 20,000,000 transactions per day. How many developers in Google mail? I don't know. I don't think that it's more than 100. So, we get 200,000 transaction per day per developer.

If we compare ratios, then we have 200,000 transaction per day per developer in Google mail and 2,000 in Stone. The ratio of users per developers is 100,000 for Google mail, and 50 for Stone. I think that above numbers for Google are much lower than they are in reality, maybe 10 or 100 times lower. What I'm trying to say is this: these ratios should be considered when planning application development.

Let's go back to AJAX. As I said, AJAX is much more sopchisticated methodology than straight JSP or other simpler alternatives. However, with Google Mail it makes a perfect sense to use AJAX, because a user base is so big that a potential return on improved user experience could be (and is) enormous. On the other hand, for Stone MS Access and VisualBasic were Ok. A potential return on improved user experience would not justify the increased development time. It's because the ratio of users per developer is low.


Alice Marshall said...

Care to elaborate on what you mean by ugly? Just ugly to look at when it is written out? Or ugly in some other way?

Argyn said...

It's ugly to look :)

I'm developing in Java. Javascript is a different language. The AJAX code in Javascript looks ugly to me.