C
C
chakaponi2019-01-01 01:48:39
JavaScript
chakaponi, 2019-01-01 01:48:39

What data storage technology in the browser to use?

Cookies, Web SQL, IndexedDB, Local Storage. Cookies are generally clear, but what about the other options? Which of these is obsolete, what are the restrictions, which is used for what purpose?
If you need to store static data for a browser extension, is it better to do it in code or use one of the provided technologies? If so, which one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2019-01-01
@chakaponi

WebSQL, alas, became deprecated even before it left the draft. Browsers immediately rushed to embed SQLite, and Oracle got scared and pushed through Mozilla that browser storage should be key-value. In some places (to be frank, in Chromium-based browsers) it still works, but when it will fall off is unknown.
IndexedDB has one distinct advantage over localStorage: by default, the available space is noticeably larger. The rest is up to taste, especially since there are facade add-ons on top of all three types of localForage .
If these are user settings, then there are no alternatives to chrome.storage . If this is the data necessary for the extension itself to work (say, level maps for the game), then it is easier and more logical to keep it in, for example, JSON.

V
Vladimir, 2019-01-01
@Casufi

https://developer.mozilla.org/uk/docs/Web/API/Wind...
https://developer.mozilla.org/ru/docs/Web/API/Wind...
https://developer. mozilla.org/en-US/docs/Web/API/I...
https://caniuse.com/#feat=indexeddb

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question