Information Technology News.


Indexed DB API 2.0 to improve the way app developers can store data

Share on Twitter.

Sponsered ad: Get a Linux Enterprise server with 92 Gigs of RAM, 16 CPUs and 8 TB of storage at our liquidation sale. Only one left in stock.

Sponsered ad: Order the best SMTP service for your business. Guaranteed or your money back.

October 31, 2016

The 'Indexed Database API 2.0' has arrived (in draft form) and it promises a variety of various improvements in the manner developers of applications can store specific data inside web browsers. As you might expect, some have been waiting for this for a while now.

To be sure, Indexed DB is a JavaScript-based object-oriented database within modern web browsers. It began taking shape a little more than five years ago. It met with W3C approval in late 2015.

IndexedDB is particularly useful for web applications that need to store large amounts of data to function offline, and for Progressive Web Apps.

It's important to note that there's a second version under consideration as well. IndexedDB is one of several client-side storage options for web apps.

Unlike Cookies and DOM Storage, IndexedDB works asynchronously, so its various operations don't block other operations while active.

Although broad support for IndexedDB has been slow in coming, Apple just recently implemented its full support in Safari 10. It's now a worthy choice for storing significant amounts of structured data in the browser.

In a blog post last week, Bevis Tseng, a platform engineer at Mozilla, underscored some of the new capabilities coming to IndexedDB in Firefox 51, available for developers now and scheduled for the general public in about two months from now.

Developers will be happy to learn that the IndexedDB API 2.0 offers a 'setter' to rename existing object stores and indexes, via IDBObjectStore.name and IDBIndex.name.

It also provides a way to listen for storage change events through the IDBDatabase.onclose() event handler.

The updated API also adds some limited support for binary data types as index keys. "Now you can have binary signatures as keys directly, without serializing them into strings or array objects as required by the previous API version," Tseng asserted.

And a variety of other methods have been added that also improve how database keys can be accessed, such as IDBObjectStore.getKey (query), IDBObjectStore.openKeyCursor (range, direction), and getAll/getAllKeys (range, count).

For now, IndexedDB doesn't yet support JavaScript Promises – a way to deal with events that may succeed or fail while running asynchronous code – but there's already a proposal and there are libraries that provide support.

For those who have yet to store client-side data in web apps, IndexedDB is worth a look. We'll keep you posted.

Source: The Mozilla Development Team.


Sponsered ad: Get a Linux Enterprise server with 92 Gigs of RAM, 16 CPUs and 8 TB of storage at our liquidation sale. Only one left in stock.

Sponsered ad: Order the best SMTP service for your business. Guaranteed or your money back.

Share on Twitter.

IT News Archives | Site Search | Advertise on IT Direction | Contact | Home

All logos, trade marks or service marks on this site are the property of their respective owners.

Sponsored by Sure Mail™, Avantex and
by Montreal Server Colocation.

       © IT Direction. All rights reserved.