HTML and CSS Reference
5.3. Managing data using IndexedDB
IndexedDB provides an API for a transactional database that is stored on the client side.
The Web Storage API stores and retrieves values using keys; IndexedDB supports more
advanced functionality, including in-order retrieval of keys, support for duplicate values,
and efficient value searching using indexes.
In the cases where the application detects no browser support for IndexedDB, you'll use
Web SQL as a fallback.
FYI: More about Web SQL
IndexedDB was added to HTML5 quite late in the specification process. As a result,
browser support for it has been much slower than with other parts of the specification. Prior
to IndexedDB, HTML5 included a client-side database specification known as Web SQL,
which defined an API for a full relational database that would live in the browser. Although
Web SQL is no longer part of HTML5, many browser vendors had already provided decent
support for it, particularly mobile browsers.
Using the IndexedDB API can be notoriously complex at first glance, particularly if you
But this section will slowly guide you in the use of IndexedDB as you add task manage-
ment features to My Tasks.
In this section, you'll learn
• How to create and connect to an IndexedDB database
• How to load existing data from an IndexedDB database
• How to perform queries on an IndexedDB database using IndexedDB's key ranges