IndexedDB
As you have seen in the previous sections, localStorage is very easy; however, it has the limitation of 5 MB of storage capacity. IndexedDB, on the other hand, does not have this limitation; however, it has a complex API. The main downside of IndexedDB is that it is not fully supported on all major browsers:
At the moment of writing this book, IndexedDB is fully supported by Chrome and Firefox, while Safari and IE have partial support.
A big difference between localStorage and IndexedDB is that IndexedDB is not a key/value store; IndexedDB has collections (tables) and a query API. If you have worked with MongoDB, you will be familiar with the way IndexedDB stores data.
Getting started with IndexedDB
An IndexedDB database is composed of one or more stores. A store is like a JSON container, it contains a collection of JSON. If you have worked with SQL, then a store is like a table. If you have worked with MongoDB, a store is a like a collection...