Indexed Database API

Last updated
IndexedDB
Indexed Database API
AbbreviationIndexedDB
Native name
Indexed Database API
Status First Public Working Draft
Latest version3.0
11 March 2021 [1]
Preview versionEditor's Draft
11 March 2021 [2]
Organization
CommitteeWeb Applications Working Group
Editors
  • Ali Alabbas [1]
  • Joshua Bell [1]
Previous editors
    • Nikunj Mehta
    • Jonas Sicking
    • Eliot Graff
    • Andrei Popescu
    • Jeremy Orlow
Base standards
Related standards
Domain NoSQL databases
Website www.w3.org/TR/IndexedDB/

The Indexed Database API (commonly referred to as IndexedDB) is a JavaScript application programming interface (API) provided by web browsers for managing a NoSQL database of objects. It is a standard maintained by the World Wide Web Consortium (W3C). [1]

Contents

As an alternative to the Web storage standard, IndexedDB can provide more storage capacity. Web storage has fixed limits per website, but IndexedDB limits are "usually quite large, if they exist at all". [5]

Use cases for IndexedDB include caching web application data for offline availability. [6] Some browser modules, such as devtools or extensions, may also use it for storage.

History

Support for IndexedDB was added to Firefox version 4, [7] Google Chrome version 11, [8] Internet Explorer version 10, [9] Safari version 8, [10] and Microsoft Edge version 12. [11]

Web SQL Database was a prior API developed by Apple. [12] But Firefox refused to add support for it and argued against it becoming a standard because it would codify the quirks of SQLite. [13] [14] It was thus deprecated in favor of IndexedDB. [15]

IndexedDB 1.0 became a W3C Recommendation on January 8, 2015. [16] IndexedDB 2.0 became a W3C Recommendation on January 30, 2018. [17] [3] IndexedDB 3.0 is currently a First Public Working Draft. [1]

Performance

Because IndexedDB is running inside of the security sandbox of a browser, all operations have to go through various security layers which decreases the performance of IndexedDB. With IndexedDB 2.0 [17] the getAll() method was added which allows to improve performance on bulk read operations.


Related Research Articles

<span class="mw-page-title-main">Document Object Model</span> Convention for representing and interacting with objects in HTML, XHTML, and XML documents

The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document. Nodes can have event handlers attached to them. Once an event is triggered, the event handlers get executed.

<span class="mw-page-title-main">SQLite</span> Serverless relational database management system (RDBMS)

SQLite is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most widely deployed database engine, as it is used by several of the top web browsers, operating systems, mobile phones, and other embedded systems.

DOM Events are a signal that something has occurred, or is occurring, and can be triggered by user interactions or by the browser. Client-side scripting languages like JavaScript, JScript, VBScript, and Java can register various event handlers or listeners on the element nodes inside a DOM tree, such as in HTML, XHTML, XUL, and SVG documents.

Netscape Plugin Application Programming Interface (NPAPI) is a deprecated application programming interface (API) for web browser plugins, initially developed for Netscape Navigator 2.0 in 1995 and subsequently adopted by other browsers.

The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap. HTML5 Canvas also helps in making 2D games.

<span class="mw-page-title-main">HTML5</span> Fifth and previous version of HyperText Markup Language

HTML5 is a markup language used for structuring and presenting hypertext documents on the World Wide Web. It was the fifth and final major HTML version that is now a retired World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML Living Standard. It is maintained by the Web Hypertext Application Technology Working Group (WHATWG), a consortium of the major browser vendors.

Web storage, sometimes known as DOM storage, is a standard JavaScript API provided by web browsers. It enables websites to store persistent data on users' devices similar to cookies, but with much larger capacity and no information sent in HTTP headers. There are two main web storage types: local storage and session storage, behaving similarly to persistent cookies and session cookies respectively. Web Storage is standardized by the World Wide Web Consortium (W3C) and WHATWG, and is supported by all major browsers.

<span class="mw-page-title-main">WebGL</span> JavaScript bindings for OpenGL in web browsers

WebGL is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics, image processing, and effects in the HTML canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.

Microdata is a WHATWG HTML specification used to nest metadata within existing content on web pages. Search engines, web crawlers, and browsers can extract and process Microdata from a web page and use it to provide a richer browsing experience for users. Search engines benefit greatly from direct access to Microdata because it allows them to understand the information on web pages and provide more relevant results to users. Microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. Microdata is an attempt to provide a simpler way of annotating HTML elements with machine-readable tags than the similar approaches of using RDFa and microformats.

Cross-origin resource sharing (CORS) is a mechanism that allows a web page to access restricted resources from a server on a domain different than the domain that served the web page.

Web SQL Database is a deprecated web browser API specification for storing data in databases that can be queried using SQL variant. The technology was only ever implemented in Blink-based browsers like Google Chrome and the new Microsoft Edge, and WebKit-based browsers like Safari. As of February 2024, WebSQL is being phased out in favor of WebStorage and IndexedDB and OPFS, but still available in some contexts under restrictive conditions.

The cache manifest in HTML5 was a software storage feature which provided the ability to access a web application even without a network connection. It became part of the W3C Recommendation on 28 October 2014.

WebRTC is a free and open-source project providing web browsers and mobile applications with real-time communication (RTC) via application programming interfaces (APIs). It allows audio and video communication and streaming to work inside web pages by allowing direct peer-to-peer communication, eliminating the need to install plugins or download native apps.

Content Security Policy (CSP) is a computer security standard introduced to prevent cross-site scripting (XSS), clickjacking and other code injection attacks resulting from execution of malicious content in the trusted web page context. It is a Candidate Recommendation of the W3C working group on Web Application Security, widely supported by modern web browsers. CSP provides a standard method for website owners to declare approved origins of content that browsers should be allowed to load on that website—covered types are JavaScript, CSS, HTML frames, web workers, fonts, images, embeddable objects such as Java applets, ActiveX, audio and video files, and other HTML5 features.

HTML audio is a subject of the HTML specification, incorporating audio input, playback, and synthesis, all in the browser.

Media Source Extensions (MSE) is a W3C specification that allows JavaScript to send byte streams to media codecs within web browsers that support HTML video and audio. Among other possible uses, this allows the implementation of client-side prefetching and buffering code for streaming media entirely in JavaScript. It is compatible with, but should not be confused with, the Encrypted Media Extensions (EME) specification, and neither requires the use of the other, although many EME implementations are only capable of decrypting media data provided via MSE.

<span class="mw-page-title-main">WebAssembly</span> Cross-platform assembly language and bytecode designed for execution in web browsers

WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment.

WebXR Device API is a Web application programming interface (API) that describes support for accessing augmented reality and virtual reality devices, such as the HTC Vive, Oculus Rift, Oculus Quest, Google Cardboard, HoloLens, Apple Vision Pro, Magic Leap or Open Source Virtual Reality (OSVR), in a web browser. The WebXR Device API and related APIs are standards defined by W3C groups, the Immersive Web Community Group and Immersive Web Working Group. While the Community Group works on the proposals in the incubation period, the Working Group defines the final web specifications to be implemented by the browsers.

<span class="mw-page-title-main">Progressive web app</span> Specific form of single page web application

A progressive web application (PWA), or progressive web app, is a type of application software delivered through the web, built using common web technologies including HTML, CSS, JavaScript, and WebAssembly. It is intended to work on any platform with a standards-compliant browser, including desktop and mobile devices.

Credential Management, also referred to as a Credential Management System (CMS), is an established form of software that is used for issuing and managing credentials as part of public key infrastructure (PKI).

References

  1. 1 2 3 4 5 Web Applications Working Group (2021-03-11). Alabbas, Ali; Bell, Joshua (eds.). "Indexed Database API 3.0". W3C. W3C First Public Working Draft. Web Applications Working Group. Retrieved 2021-05-15.
  2. Web Applications Working Group (2021-03-11). Alabbas, Ali; Bell, Joshua (eds.). "Indexed Database API 3.0". W3C. Editor’s Draft. Web Applications Working Group. Retrieved 2021-05-15.
  3. 1 2 Web Applications Working Group (2018-01-30). Alabbas, Ali; Bell, Joshua (eds.). "Indexed Database API 2.0". W3C. W3C Recommendation. Web Applications Working Group. Retrieved 2021-05-16.
  4. "Indexed Database API". 2015-01-08. Retrieved 2022-04-21.
  5. "Working with IndexedDB". Google. Retrieved 19 January 2019.
  6. "Using IndexedDB". MDN. Mozilla. Retrieved 19 January 2019.
  7. "IndexedDB - MDC Doc Center". Developer.mozilla.org. Archived from the original on 2012-05-26. Retrieved 2011-02-18.
  8. "IndexedDB - Chrome Platform Status". IndexedDB - Chrome Platform Status. The Chromium Projects. 2012-05-21. Retrieved 2021-05-15.
  9. IndexedDB, MSDN, 2012-03-14, retrieved 2012-05-24
  10. "OS X Yosemite v10.10 § App Features". Apple Developers. Apple. 2017-07-09. Retrieved 2021-05-15.
  11. "IndexedDB". Can I use... n.d. Retrieved 2021-05-16.
  12. Shankland, Stephen (2010-03-12). "Consensus emerges for key Web app standard | Deep Tech - CNET News". News.cnet.com. Retrieved 2011-02-18.
  13. O'Callahan, Robert (2010-06-04). "Well, I'm Back: Not Implementing Features Is Hard". Weblogs.mozillazine.org. Archived from the original on 2020-11-09. Retrieved 2011-02-18.
  14. Ranganathan, Arun (2010-06-01). "Beyond HTML5: Database APIs and the Road to IndexedDB – Mozilla Hacks - the Web developer blog". Mozilla Hacks – the Web developer blog. Retrieved 2021-05-21.
  15. "html5 - Why is Web SQL database deprecated?". Software Engineering Stack Exchange.
  16. Web Applications Working Group (2015-01-08). Mehta, Nikunj; Sicking, Jonas; Graff, Eliot; Popescu, Andrei; Orlow, Jeremy; Bell, Joshua (eds.). "Indexed Database API". W3C. W3C Recommendation. Web Applications Working Group. Retrieved 2021-05-16.
  17. 1 2 W3C (2018-01-30). "Indexed Database API 2.0 is now a W3C Recommendation | W3C News". W3C News. Retrieved 2021-05-16.{{cite web}}: CS1 maint: numeric names: authors list (link)