All read or write operations in IndexedDB must be part of a transaction. If one of the actions within a transaction fails, none of them are applied and the database returns to the state it was in before the transaction began. Transaction A wrapper around an operation, or group of operations, that ensures database integrity. Operation An interaction with the database. For example, if you're storing people, you may want to fetch them later by their name, age, or favorite animal. The index is used to retrieve records in the object store by this property. Index A kind of object store for organizing data in another object store (called the reference object store) by an individual property of the data. Unlike tables in traditional databases, the actual JavaScript data types of data within the store do not need to be consistent (for example, if there are three people in the people object store, their age properties could be 53, 'twenty-five', and unknown ). For example, given an app that persists blog posts and user profiles, you could imagine two object stores. Typically, there is one object store for each type (not JavaScript data type) of data you are storing. You can think of object stores as being similar to tables in traditional relational databases. Object store An individual bucket to store data. You can create multiple databases with whatever names you choose. It contains the object stores, which in turn contain the data you would like to persist. IndexedDB terms # Database The highest level of IndexedDB. See the Further reading section for more information. Data storage limits are usually quite large, if they exist at all, but different browsers handle limits and data eviction differently. IndexedDB provides a solution.Įach IndexedDB database is unique to an origin (typically, this is the site domain or subdomain), meaning it cannot access or be accessed by any other origin. While DOM Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. This API uses indexes to enable high performance searches of this data. IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. Here is the definition of IndexedDB on MDN: In addition to the usual search, get, and put actions, IndexedDB also supports transactions. It lets you store just about anything in the user's browser. IndexedDB is a large-scale, NoSQL storage system. This simplifies the API while maintaining its structure, so anything you learn using this library can be applied to the IndexedDB API directly. We are using Jake Archibald's IndexedDB Promised library, which is very similar to the IndexedDB API, but uses promises rather than events. This text guides you through the basics of the IndexedDB API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |