Google News
logo
JavaScript IndexedDB - Interview Questions
Wxplain some Principles of IndexedDB.
The IndexedDB's fundamental concepts are briefly explained below:

1) IndexedDB databases keep key-value pairs.
* The values stored in the IndexedDB, as opposed to localStorage and sessionStorage, can be complicated structures like objects and blobs.
* Keys can also be binary items, or they can be the characteristics of these things.
* Any property of the objects can be used to generate indexes for easy searching and sorting.

2) IndexedDB supports transactions
* A transaction always takes place while reading from or writing to an IndexedDB database.
* Users who launch a web-based application in two tabs or windows at once and read from the database and write the same database are protected by the transactional model, which guarantees data integrity.

3) The IndexedDB API is primarily asynchronous.
* Asynchronous operations are used by IndexedDB. When an operation is finished, and the output is accessible, it notifies you using DOM events.

4) The NoSQL system IndexedDB
* NoSQL technology is used by IndexedDB. To query data, it does not utilize SQL, in other words.
* It makes use of the cursor-returning query instead. Then, you may iterate the result set using the pointer.

5) IndexedDB adheres to the same-origin rule
* An origin is the URL of the page that contains the protocol, domain, and port where the code is executed.
* domain: freetimelearning.com
* protocol: https
* port: 443
* IndexedDB follows the same-origin principle. It implies that every origin has a unique collection of databases. Additionally, one origin is unable to access databases from different sources.
Advertisement