The Rain and The Shade

January 5, 2012

Html In browser Database do we really need it?

Filed under: Html5 — ovaisakhter @ 9:31 pm

Last night I was watching Mel Gibson’s Payback on the TV. One interesting thing in the movie is that every one keeps on saying that Mel needs his 130000 bucks back and the poor man keeps on telling them its 70000 and in the end he gets the 130000 bucks.

I have been working on web technologies for last 12 years and in all this time I have never heard anyone saying “if only we can have a database in the browser”. We had discussed a lot of time the limitations posed by the limited client side storage available in the browsers, and I have heard things a number of things like “if only we could store a little more information on the client side”.

A number of technologies were created to over come the limitations of the traditional web technologies frameworks  like Flash and Silverlight are two good examples, but no one of these technologies tried to provide any features to provide a database on the client side.

We have gone leaps and bounds in terms of programming languages and tools that interact with databases. There are frameworks which will make your lives much easier. In .Net world we have technologies like Entity Framework which can simplify the data access code a great deal. Using type safe languages like C, Java, C# you can write highly maintainable and robust business logic code . Having database coded on the browser will make us a step in a back direction. JavaScript doesn’t strikes me as one of the most maintenance friendly language. Eventually we will see a lot of data access, business logic code written in a language not known for its maintainability which may result in a maintenance nightmare. I recently had an experience while making a prototype with two tables proved to be a nightmare. Every slight change caused me to change the code at a number of places and introduced bugs in the code more frequently then a code written in a more type safe language. Of course I would have used something like Entity framework if I was coding it for server which could have been 50 times efficient in coding and maintainability.

Usually the JavaScript developers are not the guys making a lot business oriented code, application written with these newly acquired power could suffer some week coding standards.   

The browser database is temporary in nature and is gone as soon as you wipe clean your browser history. This essentially means that the data has to be saved to a server based data source this means there will be a lot of code that will be written twice. 

New breed of client applications mean new breed of server side applications. Business applications that are built for connected access will not be compatible with the new breed of disconnected scenarios. The new applications made for these scenarios will have to take care of the problems which come with the territory of distributed databases hence increasing their complexity.              

After all this discussion one question comes to my mind is “Why now?”. Internet connectivity has been improving every day. There will be less and less business scenarios which will require disconnected access. For these rare scenarios there are already enough solutions. So feels rather absurd that connectivity is increasing every day and we are coming up with solutions to make disconnected business applications.

So as poor mister porter said we only need 70000 bucks which means we could have been satisfied with the offline storage and may not needed a full blown database in the browser.   


  1. V Nice thoughts sir. Completely agree with all what you have said. I hate JS for the same reasons which you mentioned but it does not have any alternate so you have to use it even if you are building a single page web application. Though this statement is kind of true if some company doesn’t have developers who know what they are doing

    “Usually the JavaScript developers are not the guys making a lot business oriented code, application written with these newly acquired power could suffer some week coding standards.”

    But on the other side their are companies like who are doing AMAZING things with JS yet maintaining a huge software!

    Comment by rizwansharp — January 5, 2012 @ 11:53 pm | Reply

    • Of course there must be some great people around who can do it but I am talking about the majority here. trust me if you can manage a huge code base in JavaScript you are a freaking genius

      Comment by ovaisakhter — January 5, 2012 @ 11:58 pm | Reply

  2. I wanted to say “Facebook” after “But on the other side their are companies like”..

    Comment by rizwansharp — January 6, 2012 @ 12:06 am | Reply

  3. who writes javascript by hand anyway these days… !? maybe you should start seeing JS more as an intermediate language and start using other higher level languages that compiles into JS.

    Hanselman has a good podcast about the subject

    Comment by burningice2866 — March 6, 2012 @ 9:57 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: