Skip to content

Origin Private File System (OPFS) #172

@tomayac

Description

@tomayac

Description

The origin private file system is a storage endpoint that, as the name suggests, is private to the origin of the page. While browsers typically implement this by persisting the contents of this origin private file system to disk somewhere, it is not intended that the contents be easily user accessible. Similarly, there is no expectation that files or directories with names matching the names of children of the origin private file system exist. While the browser might make it seem that there are files, internally—since this is an origin private file system—the browser might store these "files" in a database or any other data structure.

Rationale

Getting access to the local file system for building reliable local storage has been identified as one of the core developer needs all the way back in 2019 in the MDN Developer Needs Assessment. The OPFS is what powers, among other things, Photoshop on the Web. Developers from the database community highly anticipate the underlying SyncAccessHandles API as a way to Bring-Your-Own-Database (BYOD) to the web. From the developer of DuckDB:

“Now that we have a WebAssembly version of DuckDB running, we realized that this API proposal here holds a tremendeous(!) potential in the form of locally persistent fast embedded databases in browsers.”

Since the release of Photoshop, the feature usage has increased significantly. As database developers such as SQLite and DuckDB migrate to the SyncAccessHandles API, we expect the BYOD use case to increase dramatically in popularity and likely replace some IndexedDB usage.

The feature is currently supported by Chrome and Safari.

Specification

File System—Living Standard

Tests

wpt / fs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions