Indexed DB API Flashcards
What is IndexedDB?
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high performance searches of this data. While DOM Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution.
How does IndexedDB lets you store and retrieve objects that are indexed?
With a key.
What kind of objects can be stored in IndexedDB?
Any objects supported by the structured clone algorithm.
What are the steps in IndexedDB usage?
You need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions.
Why are operations performed using IndexedDB are done asynchronously?
So as not to block applications.
Where is client side data stored?
On your local disk.
How do you get access to a database?
Call open() on the indexedDB attribute of a window object.
What does the open() method return?
An IDBRequest object.
Asynchronous operations communicate to the calling application by firing events on what kind of objects?
On IDBRequest objects.
Connecting to a database: describe IDBEnvironment.
Provides access to IndexedDB functionality. It is implemented by the window and worker objects.
Connecting to a database: describe IDBFactory.
Provides access to a database. This is the interface implemented by the global object indexedDB and is therefore the entry point for the API.
Connecting to a database: describe IDBOpenDBRequest.
Represents a request to open a database.
Connecting to a database: describe IDBDatabase.
Represents a connection to a database. It’s the only way to get a transaction on the database.
Retrieving and modifying data: describe IDBTransaction.
Represents a transaction. You create a transaction on a database, specify the scope (such as which object stores you want to access), and determine the kind of access (read only or readwrite) that you want.
Retrieving and modifying data: describe
IDBRequest.
Generic interface that handles database requests and provides access to results.