Indexed database (Windows Runtime apps)

Applies to Windows and Windows Phone

Indexed Database, or IndexedDB, is a web standard for a database of records holding simple values and hierarchical objects. It is a low-level ISAM database API. Records consist of key-value pairs that may be indexed in a variety of ways. (For more technical details, see the W3C specification.)

IndexedDB databases are usable within Windows Runtime apps using JavaScript via asynchronous APIs from JavaScript referenced from the page or in a web worker. Synchronous APIs are not supported. By default, only local context pages and web context pages that are declared in the ApplicationContentUriRules portion of the app’s package manifest can use IndexedDB. For info about how to use ApplicationContentUriRules to make a connection to web context pages, see How to link to external web pages. Other web context pages see the window.indexedDB and worker.indexedDB objects as undefined in JavaScript. You can make IndexedDB available for other websites via a meta tag, but be aware that this site can consume the app’s entire quota with no means for the app to purge this data. Only the user uninstalling the app can reclaim this space. Here's the meta tag that enables this behavior:


<meta name="ms-enable-external-database-usage" content="true"/>

Each app has a quota of 250MB. Among all apps on the device, the limit is 4% of the disk size or 20GB, whichever is smaller. For hard drives that are less than 30GB, the limit among all apps on the device is 375MB. Because of the overall quota among all apps, test your app to ensure it functions properly when it can store very little or even no data because other apps consume the overall quota. IndexedDB is primarily useful as a place to cache data from a web service for offline use.

Related topics

Indexed Database API
IndexedDB sample

 

 

Show:
© 2014 Microsoft