Browser makers, grappling with outmoded technology and a vision to rebuild the Web as a foundation for applications, have begun converging on a seemingly basic by very important element of cloud computing.
That ability is called local storage, and the new mechanism is called Indexed DB.
Indexed DB, proposed by Oracle and initially called WebSimpleDB, is largely just a prototype at this stage, not something Web programmers can use yet. But already it's won endorsements from Microsoft, Mozilla, and Google, and together, Internet Explorer, Firefox, and Chrome account for more than 90 percent of the usage on the Net today.
"Indexed DB is interesting to both Firefox and Microsoft, so if we get to the point where we prototype it and want to ship it, it will have very wide availability," said Chris Blizzard, director of evangelism for Mozilla.
And standardization could come. Advocates have worked Indexed DB into the considerations of the W3C, the World Wide Web Consortium that standardizes HTML and other Web technologies. In the W3C discussions, Indexed DB got a warm reception from Opera, the fifth-ranked browser.
Microsoft comes to the table
The creation of the Indexed DB interface is notable for another reason: Microsoft.
For years, Microsoft essentially sat out a lot of HTML discussions. Now, though, become closely involved, for example through detailed feedback from Pablo Castro, a Microsoft software architect. Castro not only praised Indexed DB on his blog, but also said that Microsoft is hiring staff to work on Indexed DB.
Finally, Microsoft publicly endorsed Indexed DB on its IE blog: "Together with Mozilla, we're excited about a new design for local storage called Indexed DB. We think this is a great solution for the Web," said program manager Adrian Bateman.
Microsoft's praise is important. For one thing, the company maintains a dominant, though diminishing, share of browser usage, so even Web programmers who've scorned the company's earlier lack of interest in advancing Web technologies should pay attention to what it says. They should pay even more attention when Microsoft and its longtime arch-rival Mozilla agree on something. Microsoft's cooperation makes it more likely Indexed DB will be a real tool for Web programmers, not just an academic concept with little real-world relevance.
For another, Microsoft is working hard on the next generation of its browser, withnext week. Though the company has been mostly mum about what new technologies will arrive in its updated browser, its activity signals that the company is very serious about the market.
Local or on the Net?
It may sound perverse, but the ability to store data locally on a computer turns out to be a very important part of the Web application era that's really just getting under way. The whole idea behind cloud computing is to put applications on the network, liberating them from being tied to a particular computer, but it turns out that the computer still matters, because the network is neither fast nor ubiquitous.
Local storage lets Web programmers save data onto computers where it's convenient for processors to access. That can mean, for example, that some aspects of Gmail and Google Docs can work while you're disconnected from the network. It also lets data be cached on the computer for quick access later. The overall state of the Web application is maintained on the server, but stashing data locally can make cloud computing faster and more reliable.
"Building a database to store a line of text is like hitting metal screws into wood with a very big hammer--it works, but it probably isn't the best way. But for managing large-scale data in Web applications and widgets, a real database is more valuable," said Charles McCathieNevile, Opera's chief standards officer. That enables offline e-mail, better management of bookmarks, dictionaries, synchronized contacts, and other sophisticated abilities, he said.
Web browsers have been able to store data locally for years in a primitive fashion through small text files called cookies. Browser makers have been casting about for a more powerful mechanism, though, resulting in a hodge-podge of possibilities.
One newer method, appropriately enough called LocalStorage, is supported in Firefox and IE 8. But even as it becomes formally standardized through the W3C as Web Storage, browser makers have recognized its limits for modern browser designs.
One problem is that LocalStorage stems from the days when browser computing took place in a single computing process, a design that meant programmers didn't have to worry about one browser task meddling with data that another browser task thought it was controlling. With multi-process browsers arriving--Chrome is an example today, and Firefox is moving in that direction--browsers get the ability to do more things in parallel, and LocalStorage can't keep up.
"Because more than one [browser] tab can access the same data, you have to make sure that what one tab does is seen by others at the same time," Blizzard said. "That's extra-hard with a browser that might have more than one process."
The rise and fall of Web SQL
Another local storage method from Apple, Web SQL and sometimes called Web DB, offers more sophistication and enjoyed a start in the HTML standards process. It employed an ages-old standard for storing and retrieving data called Structured Query Language.
Safari supports Web SQL, as do Opera since the technology is in use on the Web.and
Web SQL ran into problems, though. SQL has as many variations as there are databases that support it, and Web SQL used one from software called SQLite. That interface isn't standardized, though.
Google, despite the fact that its Gears browser plug-in uses a SQL interface to provide offline access to Gmail and other services, shares the concern that "the dialect of SQL is currently not specified," spokesman Eitan Bencuya said. "There are ongoing conversations about specifying in greater detail the exact dialect of SQL that should be supported for this feature."
Maciej Stachowiak, an Apple programmer, pointed out that there will be multiple shipping versions of Web SQL in a W3C discussion of local storage technologies. But his argument didn't prevail.
"I don't want to work on a spec without five out of five implementations," said Ian Hickson, the editor of the HTML5 specification and a Google employee, in the W3C meeting, referring to the lack of support from all the five top browser makers.
And indeed, the draft specification now includes these words: "This specification has reached an impasse," because it uses the SQLite interface. Somebody interested in an independent SQL interface can "please contact the editor so that he can write a specification for the dialect, thus allowing this specification to move forward."
Enter Indexed DB
Indexed DB brings the database approach to browsers, but keeps the interface at a very low level.
"What we've learned from the recent history of the Web is that putting out simple APIs [application programming interfaces] that push decisions and complexity to the edges is a strategy that works. The way that the Web works today is that programmers aren't using a lot of browser APIs directly. Instead they are using jQuery or Dojo or one of the other libraries that are out there for doing cross-browser and cross-version compatibility," Blizzard said. "We think that instead of delivering an API that's complicated and underspecified that will cause browser vendors and developers to have to struggle with incompatible APIs, that we can deliver something that is simple, well-specified and understood that developers and people building Web browsers can build on."
It's not clear yet what Opera will do, but McCathieNevile had words of praise in the W3C meeting. "We found Nikunj to be more to our liking," he said, according to the meeting notes, referring to Indexed DB, which was written by an Oracle employee, Nikunj Mehta.
Apple declined to comment about its support for IndexedDB.
However, if IE, Mozilla, and Chrome support Indexed DB, and it becomes a W3C standard, it's likely Apple won't have much choice, because programmers will begin to use it.
Happily for Apple, Google has detailed its approach in a Chrome design document and has begun checking Indexed DB code into WebKit, the open-source project that underlies both Safari and Chrome. That means Apple will be able to adopt a tested version of the technology relatively quickly.
Indexed DB isn't a sure thing yet, to be sure, and the drawn-out history of LocalStorage shows that being established in the standards process isn't everything.
But Indexed DB has powerful allies in the right places and is on its way to being technology Web developers can at least start trying. With time, it stands to become a key part of the Web application world.
Updated 3:34 p.m. PSTwith Google comment.
Corrected 6:01 a.m. PDT March 15to note that Opera has completed the addition of Web SQL support.