IndexedDB: Difference between revisions

Content deleted Content added
Remove opinionated language
Removing notice of move discussion
 
(32 intermediate revisions by 23 users not shown)
Line 1:
{{Short description|JavaScript application programming interface}}
The '''Indexed Database API''' (commonly referred to as '''IndexedDB''') is a [[JavaScript]] [[application programming interface]] (API) provided by [[web browser]]s for managing a [[NoSQL]] [[database]] of [[JSON]] objects. It is a standard maintained by the [[World Wide Web Consortium]] (W3C).<ref>{{cite web|url = http://www.w3.org/TR/IndexedDB/|title = IndexedDB API|publisher = W3.org|date = |accessdate = 2015-12-04}}</ref>
{{Infobox technology standard
| title = IndexedDB
| long_name = Indexed Database API
| native_name = Indexed Database API
| native_name_lang = en
| image =
| caption =
| status = [[World Wide Web Consortium#Working draft (WD)|First Public Working Draft]]
| year_started = <!-- {{Start date|YYYY|MM|DD|df=y}} -->
| first_published = <!-- {{Start date|YYYY|MM|DD|df=y}} -->
| version = 3.0
| version_date = 11 March 2021<ref name="standard">{{Cite web|url=https://www.w3.org/TR/IndexedDB/|title=Indexed Database API 3.0|editor-first=Ali|editor-last=Alabbas|editor-first2=Joshua|editor-last2=Bell|author=Web Applications Working Group|publisher=Web Applications Working Group|website=W3C|version=W3C First Public Working Draft|date=2021-03-11|access-date=2021-05-15}}</ref>
| preview = Editor's Draft
| preview_date = 11 March 2021<ref name="standard-draft">{{Cite web|url=https://w3c.github.io/IndexedDB/|title=Indexed Database API 3.0|editor-first=Ali|editor-last=Alabbas|editor-first2=Joshua|editor-last2=Bell|author=Web Applications Working Group|publisher=Web Applications Working Group|website=W3C|version=Editor's Draft|date=2021-03-11|access-date=2021-05-15}}</ref>
| organization = {{Plainlist|
* {{abbr|[[World Wide Web Consortium|W3C]]|World Wide Web Consortium}}
* [[Google]]
* [[Microsoft]]
* [[Mozilla]]<ref name="standard-v2" />
* [[Oracle Corporation|Oracle]]<ref name="standard-2015">{{Cite web|url=https://www.w3.org/TR/2015/REC-IndexedDB-20150108/#h-acknowledgements|title=Indexed Database API|date=2015-01-08|access-date=2022-04-21}}</ref>
}}
| committee = Web Applications Working Group
| editors = {{Plainlist|
* Ali Alabbas<ref name="standard" />
* Joshua Bell<ref name="standard" />
}}
{{Collapsible list|title=Previous editors|
* Nikunj Mehta
* Jonas Sicking
* Eliot Graff
* Andrei Popescu
* Jeremy Orlow
}}
| authors =
| base_standards = {{Plainlist|
* [[Document Object Model|HTML DOM]]
* [[HTML5 File API|File API]]
* Infra Standard
* [[JSON]]
* Storage Standard
}}
| related_standards = {{Plainlist|
* [[HTTP cookie]]
* [[Web SQL Database]]
}}
| abbreviation = IndexedDB
| ___domain = [[NoSQL]] [[database]]s
| license =
| website = {{URL|https://www.w3.org/TR/IndexedDB/}}
}}
 
The '''Indexed Database API''' (commonly referred to as '''IndexedDB''') is a [[JavaScript]] [[application programming interface]] (API) provided by [[web browser]]s for managing a [[NoSQL]] [[database]] of [[JSON]] objects. It is a standard maintained by the [[World Wide Web Consortium]] (W3C).<ref>{{cite web|url name="standard" http://www.w3.org/TR/IndexedDB/|title = IndexedDB API|publisher = W3.org|date = |accessdate = 2015-12-04}}</ref>
As an alternative to the [[Web storage]] standard, IndexedDB can provide more storage capacity. Web storage has [[Web_storage#Storage_size|fixed limits]] per [[website]], but IndexedDB limits are "usually quite large, if they exist at all".<ref>{{cite web |title=Working with IndexedDB |url=https://developers.google.com/web/ilt/pwa/working-with-indexeddb |publisher=Google |accessdate=19 January 2019}}</ref>
 
As an alternative to the [[UseWeb casestorage]]s forstandard, IndexedDB includecan cachingprovide more storage capacity. Web storage has [[webWeb storage#Storage size|fixed applicationlimits]] data forper [[offlinewebsite]], but IndexedDB limits are "usually quite large, if they exist at availabilityall".<ref>{{cite web |title=UsingWorking with IndexedDB |url=https://developerdevelopers.mozillagoogle.orgcom/en-USweb/docsilt/Webpwa/API/IndexedDB_API/Using_IndexedDB |website=MDNworking-with-indexeddb |publisher=MozillaGoogle Inc. |accessdateaccess-date=19 January 2019}}</ref> Some browser modules, such as [[Web development tools|devtools]] or [[browser extension|extensions]], may also use it for storage.
 
[[Use case]]s for IndexedDB include caching [[web application]] data for [[offline]] availability.<ref>{{cite web |title=Using IndexedDB |url=https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB |website=MDN |publisher=Mozilla |access-date=19 January 2019}}</ref> Some browser modules, such as [[Web development tools|devtools]] or [[browser extension|extensions]], may also use it for storage.
 
==History==
Support for IndexedDB was added to [[Firefox]] version 4,<ref>{{cite web |url=https://developer.mozilla.org/en/IndexedDB |title=IndexedDB - MDC Doc Center |publisher=Developer.mozilla.org |access-date= |accessdate=2011-02-18 |archive-date=2012-05-26 |archive-url=https://web.archive.org/web/20120526230025/https://developer.mozilla.org/en/IndexedDB |url-status=dead }}</ref> [[Google Chrome]] version 11,<ref>{{cite web|url=https://wwwchromestatus.chromium.orgcom/developersfeature/web-platform-status#TOC-Indexed-Database-API- 6507459568992256|title=WebIndexedDB - Chrome Platform Status|website=IndexedDB - Chrome Platform Status|publisher=The Chromium Projects |date=2012-05-21 |accessdateaccess-date=20122021-05-2415}}</ref> and [[Internet Explorer]] version 10.,<ref>{{citation |url=http://msdn.microsoft.com/en-us/library/ie/hh673548(v=vs.85).aspx |title=IndexedDB |publisher=MSDN |date=2012-03-14 |accessdateaccess-date=2012-05-24}}</ref> [[Safari (web browser)|Safari]] added support in version 8.,<ref>{{cite web|url=https://developer.apple.com/library/content/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_10.html#//apple_ref/doc/uid/TP40014484-SW1|title=What'sOS NewX inYosemite macOSv10.10 § App Features|publisher=Apple |datewebsite=Apple Developers|accessdatedate=2017-07-09|access-date=2021-05-15}}</ref> and [[Microsoft Edge]] version 12.<ref name="caniuse-indexeddb">{{Cite web|url=https://caniuse.com/indexeddb|title=IndexedDB|website=Can I use...|date=n.d.|access-date=2021-05-16}}</ref>
 
[[Web SQL Database]] was a prior API developed by [[Apple Inc.|Apple]].<ref>{{cite web|last=Shankland |first=Stephen |url=httphttps://newswww.cnet.com/8301news/consensus-30685_3emerges-20000376for-264.html key-web-app-standard/|title=Consensus emerges for key Web app standard &#124; Deep Tech - CNET News |publisher=News.cnet.com |date=2010-03-12 |accessdateaccess-date=2011-02-18}}</ref> But Firefox refused to add support for it and argued against it becoming a standard because it would codify the quirks of [[SQLite]].<ref>{{cite web|url=httphttps://weblogsrobert.mozillazineocallahan.org/roc2010/archives06/not-implementing-features-is-hard_03.html|archive-url=https://web.archive.org/web/20201109032423/http://robert.ocallahan.org/2010/06/not_implementinnot-implementing-features-is-hard_03.html |title=Well, I'm Back: Not Implementing Features Is Hard |author-first=Robert|author-last=O'Callahan|publisher=Weblogs.mozillazine.org |date= 2010-06-04|accessdateaccess-date=2011-02-18|archive-date=2020-11-09}}</ref><ref>[{{Cite web|url=https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/ |title=Beyond HTML5: Database APIs and the Road to IndexedDB] – Mozilla Hacks - the Web developer blog|website=Mozilla Hacks – the Web developer blog|author-first=Arun|author-last=Ranganathan|date=2010-06-01|access-date=2021-05-21}}</ref> It was thus [[deprecation|deprecated]] in favor of IndexedDB.<ref>{{Cite web|url=https://softwareengineering.stackexchange.com/questions/220254/why-is-web-sql-database-deprecated|title=html5 - Why is Web SQL database deprecated?|website=Software Engineering Stack Exchange}}</ref>
 
''IndexedDB 1.0'' became a [[World Wide Web Consortium#W3C recommendation (REC)|W3C Recommendation]] on January 8, 2015.<ref name="standard-v1">{{Cite web|url=https://www.w3.org/TR/2015/REC-IndexedDB-20150108/|title=Indexed Database API|date=2015-01-08|access-date=2021-05-16|publisher=Web Applications Working Group|author=Web Applications Working Group|website=W3C|version=W3C Recommendation
|editor-first1=Nikunj|editor-last1=Mehta
|editor-first2=Jonas|editor-last2=Sicking
|editor-first3=Eliot|editor-last3=Graff
|editor-first4=Andrei|editor-last4=Popescu
|editor-first5=Jeremy|editor-last5=Orlow
|editor-first6=Joshua|editor-last6=Bell
}}</ref> ''IndexedDB 2.0'' became a W3C Recommendation on January 30, 2018.<ref name="w3c-blog-indexeddb-2.0">{{Cite web|url=https://www.w3.org/blog/news/archives/6795|title=Indexed Database API 2.0 is now a W3C Recommendation {{!}} W3C News|website=W3C News|author=W3C|date=2018-01-30|access-date=2021-05-16}}</ref><ref name="standard-v2">{{Cite web|url=https://www.w3.org/TR/IndexedDB-2/|title=Indexed Database API 2.0|date=2018-01-30|access-date=2021-05-16|publisher=Web Applications Working Group|author=Web Applications Working Group|website=W3C|version=W3C Recommendation
|editor-first=Ali|editor-last=Alabbas
|editor-first2=Joshua|editor-last2=Bell
}}</ref> ''IndexedDB 3.0'' was released as a [[World Wide Web Consortium#Working draft (WD)|First Public Working Draft]] on 11 March 2021 and remains as a Working Draft {{As of|2024|12|3|lc=y}}.<ref>{{Cite web |date=2024-11-07 |title=Indexed Database API 3.0 publication history |url=https://www.w3.org/standards/history/IndexedDB-3/ |archive-url=https://web.archive.org/web/20241203185526/https://www.w3.org/standards/history/IndexedDB-3/ |archive-date=2024-12-03 |access-date=2024-12-03 |website=W3C |language=en}}</ref>
 
==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<ref name="w3c-blog-indexeddb-2.0">{{Cite web|url=https://www.w3.org/blog/news/archives/6795|title=Indexed Database API 2.0 is now a W3C Recommendation {{!}} W3C News|website=W3C News|author=W3C|date=2018-01-30|access-date=2021-05-16}}</ref> the getAll() method was added which allows to improve performance on bulk read operations.
[[Web SQL Database]] was a prior API developed by [[Apple Inc.|Apple]].<ref>{{cite web|last=Shankland |first=Stephen |url=http://news.cnet.com/8301-30685_3-20000376-264.html |title=Consensus emerges for key Web app standard &#124; Deep Tech - CNET News |publisher=News.cnet.com |date=2010-03-12 |accessdate=2011-02-18}}</ref> But Firefox refused to add support for it and argued against it becoming a standard because it would codify the quirks of [[SQLite]].<ref>{{cite web|url=http://weblogs.mozillazine.org/roc/archives/2010/06/not_implementin.html |title=Well, I'm Back: Not Implementing Features Is Hard |publisher=Weblogs.mozillazine.org |date= |accessdate=2011-02-18}}</ref><ref>[https://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/ Beyond HTML5: Database APIs and the Road to IndexedDB]</ref> It was thus [[deprecation|deprecated]] in favor of IndexedDB.<ref>https://softwareengineering.stackexchange.com/questions/220254/why-is-web-sql-database-deprecated</ref>
 
==References==
Line 15 ⟶ 83:
==External links==
* [https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API IndexedDB API] on [[MDN Web Docs]]
* [https://nolanlawson.github.io/database-comparison/ Browser database comparison]
 
{{Web browsers|fsp}}
{{Web interfaces}}
{{W3C standards}}
 
{{DEFAULTSORT:Indexed Database Api}}
[[Category:World Wide Web Consortium standards]]
[[Category:Database APIs]]
[[Category:Web technology]]