This is the 21st day of my participation in Gwen Challenge


The Storage Foundation API is similar to a basic file system, providing direct access to stored data through buffers and offsets. It provides a common, simple API that provides flexibility for developers. This makes it possible to build more advanced components.

Increasingly, web platforms provide developers with the tools they need to build high-performance applications. Most remarkable of all

  • Wasm opens the door to fast and powerful Web applications,
  • Technologies like Emscripten now allow developers to reuse time-tested code on the Web. To truly take advantage of this potential, developers must be equally powerful and flexible with storage.

This is where the Storage Foundation API comes in. The Storage Foundation API is a new fast and closed Storage API that unlocks new and heavily requested Web use cases, such as implementing execution databases and gracefully managing large temporary files. With this new interface, developers can “bring their own storage” to the Web, narrowing the functional gap between The Web and platform-specific code.

The Storage Foundation API is designed to resemble a very basic file system, so it gives developers the flexibility to build more advanced components by providing generic, simple, and executable raw components. Applications can meet their needs with the best tools to find the right balance between availability, performance, and reliability.

Why do we need another storage API?

Before we do that, let’s take a look at existing client storage technologies:

cookie / sessionStorage / localStorage

Only very small amounts of data are allowed to be stored. Even the larger of these, localStorage, has only about 5M space in the browser

File and Directory Entries API / WebSQL

Abandoned for various reasons

File System Access API

The focus is different. Provides a client-side file system interface and provides access to data that may be from different sources and even outside the browser. This different focus comes with more stringent security considerations and higher performance costs

indexedDB API

Can be used as a back end for some use cases of the Storage Foundation API. For example, Emscripten has IDBFS, which is an Indexeddb-based persistent file system. But because indexedDB is fundamentally a key-value database, it has significant performance limitations.

In addition, under indexedDB, direct access to the bytes of a file is difficult and performance is poor.

CacheStorage interface

The CacheStorage Interface is widely supported by browsers and is used to store large data such as Web application resources, but does not provide an interface to manipulate the stored content

The Storage Foundation API is designed to narrow all the gaps in previous Storage options by allowing practitioners to store variable-size files defined in application originals.

Recommended use cases for storage base apis

Examples of sites that might use this API include:

Productivity or creative applications that run on large amounts of video, audio, or image data. Such applications can unload segments to disk instead of keeping them in memory. Applications that rely on persistent file systems accessed from WASM have better performance than IDBFS can guarantee.