So, the last 2 weeks I have been fighting with indexedDB
and one of two recurring questions that keep popping up is why indexedDB
has to use/present it's entire versioning system? I do understand that in certain very specific cases it's a nice thing to have, but in those cases an if(localstorage.dbversion <= ...)
would do, so is there some reason in respect to browser implementations/optimalizations that require this roundabout1 system? Or does it make indexedDB far more efficient or something?
1 Roundabout because for example in onupgradeneeded
you get the transaction from event.target.transaction
whereas in onsuccess
you get it from the result.transaction()
. And there are countless of other more complex examples. (Such as cases where createStore
is called in response to various huge (too big to keep it all in memory) ajax calls))