HTML5 in the browser: Local data storage

HTML5 Web Storage, Web Database, FileReader, FileWriter, and AppCaching APIs will transform Web pages into local applications, but not yet

Page 5 of 5

The academic community has been working on this idea for some time, calling it the "semantic Web." Some suggest that these basic tags don't begin to approach the complexity needed for supersmart Web bots to do supersmart things. Others say that we need to start somewhere and the tag soup from the Microdata API will make it easier for browsers to do intelligent things.

Most browsers don't implement this yet, and it's even less clear what it means for website developers to implement the API. It's one thing to parse the tags correctly and put entries in the DOM tree. It's another to actually do something with them. It would be nice, for instance, to recognize the time tags and connect somehow with a local or global calendar, but even that simple response is beyond the API.

Any discussion of the HTML Microdata API doesn't fit perfectly with this section because it's not devoted to local storage of data. In fact, most of the tags don't seem to have much to do with the average person's Web browser. They may be more for the sake of some distant search engine buried deep inside a remote colo bunker. Or they might end up being used extensively by the next browsers and their plug-ins. It's all very open-ended.

Bottling the Web
There is no conclusion to this section of APIs. We're not even far into the beginning of the beginning of what local persistence will do to the Web. There are many, many edge conditions to work out regarding who gets access to the data, how much data will be stored, and how long the data will live.

Apart from the sessionStorage and localStorage objects, which all of the current leading browsers (Chrome, Firefox, Internet Explorer, Opera, and Safari) implement to some extent, browser support for the other APIs discussed here is sketchy. Only Chrome and Firefox implement the FileReader API. Although all but Internet Explorer (IE9 beta included) support AppCaching, none support the IndexedDB or FileWriter functions. Test your own browser's support for these functions at

Notice one other aspect of these specs: They only govern what the JavaScript programmer needs to worry about. There are many deeper questions about how we'll let the end-users know about the data stored on their machines. Some of the latest browsers already offer switches for deleting these local databases. All it takes is some poking around inside the Preferences menu, but they tend to be crude options with the subtlety of a nuclear bomb. You can either keep all of your AJAX data or delete it -- there's no middle ground.

This is just the beginning of a lengthy series of decisions that browser designers will need to make. Then the users can determine what features they absolutely need, and the privacy and flexibility they require, to use the Web effectively. The answers to these questions are a long way in the future.

Note: This is the second article in a series devoted to the new features of HTML5. The first article, "HTML5 in the browser: Canvas, video, audio, and graphics," examined display options, including the <canvas> and <video> tags, Scalable Vector Graphics, and WebGL. The third article will examine data communications and the fourth will look at a grab bag of tools such as geolocation.

This story, "HTML5 in the browser: Local data storage," was originally published at Follow the latest news in software development, languages and standards, and HTML at For the latest business technology news, follow on Twitter.

| 1 2 3 4 5 Page 5