Backbone was mainly designed to work with RESTful API servers; however, you don't want to always store the data in a server for offline applications or to bust application loading storing cache data in the browser.
We have two choices to store data in the user browser: use localStorage or the new IndexedDB API. While localStorage has wide support on major browsers, IndexedDB is the new specification that is yet to be supported in the near future. Another option that is available currently; however, in deprecated status is Web SQL. If you are developing modern web applications, you should avoid using Web SQL.
In this chapter, you will learn the following topics:
Basics of localStorage
Basics of IndexedDB
Using localStorage instead of a RESTful server to store information
Using IndexedDB instead of a RESTful server to store information