How is indexedDB conceptually different from HTML5 local storage?

后端 未结 4 1182
渐次进展
渐次进展 2020-12-12 12:58
  1. Both indexedDB and local storage are key value stores. What is the advantage of having two key/value stores?
  2. indexedDB is asynchronous, but joins (the most ti
4条回答
  •  余生分开走
    2020-12-12 13:17

    Run the following in console of browser. It will create a separate entity in Application > Storage alongside LocalStorage and SessionStorage

    const request = indexedDB.open("notes");
    request.onupgradeneeded = e => {
      alert("upgrade");
    }
    request.onsuccess = e => {
      alert("success");
    }
    request.onerror = e => {
      alert("error");
    }
    

    You can query this Storage with all CRUD operations unlike other two storages that has lesser flexibility and functions to play with.

提交回复
热议问题