by @kodeazy

How to store data in browser using IndexDB part -I

Home » javascript » How to store data in browser using IndexDB part -I

What is IndexDB and how to store data in browser using IndexDB part -I?

  • Using IndexDB we can store data in browser,unlike Local Storage it can store large amount of data in your browser and it is more powerful than Local storage.
  • Here we create database and stores.
  • stores in the sense tables in mysql and collections in mongodb.
  • Once we create database and store we can perform CRUD operations just like any other database we work using transactions.
  • Here one Domains database cannot be accessed by other domains.
  • In IndexDB database have built in mechanism of schema versioning.

To perform operations using IndexDB at first we have to check whether your browser supports IndexDB or not.

if (window.indexedDB) {
  console.log("IndexDB is supported");} else {
  console.log("IndexDB is not supported");
}

In the above code specifies whether your browser supports IndexDB or not, If your browser supports indexDB you can perform the operations.

In part -II, we will be discussing on how to create and database,stores in IndexDB and how it will be stored in IndexDB.