I came across this good article discussing about localstorage vs indexeddb and other possible options.
(all the below values are in milliseconds)
https://nolanlawson.com/2015/09/29/indexeddb-websql-localstorage-what-blocks-the-dom/
To summarize from the article (entirely author's views),
In both Firefox and Chrome, IndexedDB is slower than LocalStorage for basic key-value insertions, and it still blocks the DOM. In Chrome, it’s also slower than WebSQL, which does blocks the DOM, but not nearly as much. Only in Edge and Safari does IndexedDB manage to run in the background without interrupting the UI, and aggravatingly, those are the two browsers that only partially implement the IndexedDB spec.
IndexedDB works swimmingly well in a web worker, where it runs at roughly the same speed but without blocking the DOM. The only exception is Safari, which doesn’t support IndexedDB inside a worker, but still it doesnt block the UI.
localmemory is ideal if data is simple and minimal