HTML and CSS Reference
In-Depth Information
Figure 1.15. Adding maps showing your current location in the chapter 3 application
1.4.2. Indexed database (IndexedDB API)
The IndexedDB API provides developers with a means of storing complex data structures
in a full client-side database. The main advantage of the IndexedDB API over the Web St-
orage API is that in Web Storage the only index is the key of the key/value pair, whereas
in IndexedDB the values are fully indexable too, making it a more viable solution for any
application where you need to search or filter data. The trade-off is that the API for In-
dexedDB is much more complex, and it can be difficult to get to grips with initially.
IndexedDB is a relative newcomer to the HTML5 specification family. There had been a
different proposed solution, Web SQL (Structured Query Language), a specification that
defined a relational client-side database that used SQL statements for query and data ma-
nipulation. In the end, it was dropped because all the browsers that had adopted it were us-
ing the same implementation (an SQLite database) so it could never meet the WHATWG's
and W3C's standardization criteria of having “two independent, interoperable implement-
ations of each feature.” When it was dropped, support had already been included in several
browsers, including mobile browsers like Mobile Safari and Android. Browser support for
IndexedDB has been slow-moving, and as a result, most applications that use IndexedDB
also use Web SQL as a fallback.
In chapter 5 , you'll learn how to use IndexedDB (with a Web SQL fallback) to store task
data in a mobile task-management application, as illustrated in figure 1.16 .
Search WWH ::

Custom Search