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.