Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4608486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:51:07+00:00 2026-05-22T00:51:07+00:00

Both indexedDB and local storage are key value stores. What is the advantage of

  • 0
  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 time-consuming thing)
    are manual. They appear to run in the same thread as the async calls
    were made. How will this not block the UI?
  3. indexedDB allows a larger store. Why not increase the size of the
    HTML5 store?
  4. I’m scratching my head. What is the point of indexedDB?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:51:08+00:00Added an answer on May 22, 2026 at 12:51 am

    IndexedDB is not a key-value store in the same way that Local Storage is. Local storage just stores strings, so to put an object in local storage the usual approach is to JSON.stringify it:

    myObject = {a: 1, b: 2, c: 3};
    localStorage.setItem("uniq", JSON.stringify(myObject));
    

    This is fine for finding the object with key uniq, but the only way to get the properties of myObject back out of local storage is to JSON.parse the object and examine it:

    var myStorageObject = JSON.parse(localStorage.getItem("uniq"));
    window.alert(myStorageObject.b);
    

    This is fine if you only have one, or a few objects, in local storage. But imagine you have a thousand objects, all of which have a property b, and you want to do something just with those ones where b==2. With local storage you’ll have to loop through the entire store and check b on each item, which is a lot of wasted processing.

    With IndexedDB you can store stuff other than strings in the value: “This includes simple types such as DOMString and Date as well as Object and Array instances.” Not only that, but you can create indexes on properties of the objects that you stored in the value. So with IndexedDb you can put those same thousand objects in it but create an index on the b property and use that to just retrieve the objects where b==2 without the overhead of scanning every object in the store.

    At least that’s the idea. The IndexedDB API isn’t very intuitive.

    They appear to run in the same thread as the async calls were made. How will this not block the UI?

    Asynchronous is not the same thing as multi-threaded, JavaScript, as a rule, is not multi-threaded. Any heavy processing you do in JS will block the UI, if you want to minimize blocking the UI try Web Workers.

    indexedDB allows a larger store. Why not increase the size of the HTML5 store?

    Because, without proper indexing, it would get increasingly slower the larger it got.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Both methods MyBehavior::CreateSerializer() are not called of some reason, but ReplaceBehavior() method is working.
Both are delegates and have the same signature, but I can not use Action
I am running two very similar update queries but for a reason unknown to
function example() { foreach ($choices as $key => $choice) { # \__ both should
While reading the HTML5 IndexedDB Specification I had some doubts about its asynchronous request
Not sure how it happened, but Google has indexed my site both by IP
Is there a good, platform-agnostic way to implement a variable that's local to both
I use two different events for the callback to respond when the IndexedDB transaction
I have a simple accordion menu working using jQuery but I'm having trouble styling
I have two indexed (8-bits) Bitamp, both using the same Palette in C# (.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.