Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

HTML5's IndexedDB: tutorial series

DZone's Guide to

HTML5's IndexedDB: tutorial series

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

As a former database developer/admin, I'm often tempted to think of all computers as datastores that sometimes store particularly interesting data. After all, the most fundamental split in modern computer architecture occured over exactly where different kinds of data (including instructions) are stored.

Some of the confusion over HTML5's new database support has orbited around the data/instruction issue too. For some clarification on that front, look over Gerard Gallant's post from a few weeks ago. As Gerard observes:

To avoid any confusion, HTML 5 Web Storage is not the Index Database API or the Web SQL Database which are also HTML 5 related features that some browsers have started to support.

HTML 5 Web Storage is a form of browser storage that is similar to cookies but with several advantages.


Gerard goes on to list and discuss some of these advantages (worth browsing).

But in a way (as Gerard observes) Web Storage isn't fundamentally different from cookies. It's just a lot more powerful.

IndexedDB, on the other hand, is something different altogether. The specification is designed specifically for applications that address much larger stores than browsers using Web Storage will permit (usually just 5MB).

You can read the full spec (specs are always fascinating until they alter your state of consciousness), but for a quick overview you'd probably prefer a developer's perspective over W3's.

Providing that developer's perspective, Kristof Degrave just updated his multi-part tutorial series on creating and deleting a database, opening and a closing database connection, and defining a database structure in IndexedDB, with a nice little 'IndexedDB basics' intro thrown in for good measure.

Kristof's summary of the specification gets to the heart of IndexDB's power:

The Indexed DB specification provides an advanced key-value data management. It does this by using a transactional database to store their keys and corresponding values (more than one value for 1 key is allowed) and providing a means of traversing keys in a deterministic order.

 
Read the intro here, the creating/deleting/opening/closing tutorial here, and the defining tutorial here.

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}