Browser on-disk storage APIs:
document.cookie
— a “cookie” is the oldest persistence mechanism, by simply updating the document.cookie
property the browser will synchronously update the value.
localStorage
— synchronously stores a key-value pair on the disk, historically every write to disk used to be blocking, now browsers seem to optimize this.
WebSQL — a deprecated SQL standard for the browser.
IndexedDB — the current “database API” of the browsers. It used to have asynchronous and synchronous variants, now the synchronous variant is deprecated and works only in worker threads.
CacheStorage
— key/value storage of service workers.
FSA (File System Access) — File System Access, it is implemented using the FSA (File System API), just like, OPFS, but it gives access to real user files on their device. Requires user permission to access a file or a folder, however, the permission object can be stored in IndexDB, which is accessible after browser reload.