Chapter 25Offline Apps: Storing Data With Client-side Databases

Web storage (localStorage and sessionStorage) is fine for small amounts of data such as our to-do list, but it’s an unstructured data store. You can store keys and values, but you can’t easily search values. Data isn’t organized or sorted in a particular way, plus the 5MB storage limit is too small for some applications.

For larger amounts of structured searchable data, we need another option: web databases. Web databases such as Web SQL and IndexedDB provide an alternative to the limitations of web storage, enabling us to create truly offline applications.

The State of Client-side Databases

Unfortunately, this isn’t as easy as it sounds. Browsers are split into three camps in the ...

Get Jump Start HTML5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.