DEV Community

Discussion on: Understanding Client-Side Storage

Collapse
 
fridezlucas profile image
Lucas Fridez

Are performances not better ?

Thread Thread
 
peerreynders profile image
peerreynders • Edited

The initial proposal for IndexedDB dates back to 2010 (current) and appeared in browsers around 2011/12. For performance reasons early on it was decided to make the interface asynchronous. But native promises only became available in browsers around 2014. So the IndexedDB interface was designed around events - as in the response to a request was an event that needed to be processed by an event handler.

IndexedDB 2.0 hasn't change that. IDB is a thin wrapper around the IndexedDB event-based interface which promisifies it - i.e. with IDB promises and async/await can be used with IndexedDB.