IndexedDB Access Speed and Efficiency IndexedDB Access Speed and Efficiency dart dart

IndexedDB Access Speed and Efficiency


I am confident that hundreds of records will present you no issue in IndexedDB. IDB was designed with that kind of scale in mind, and its async APIs -- while vexing for novices -- make sure your app stays responsive by design.

I am working on a demo designed to push IDB further than it should go, and have some easy-to-reach statistics for you. These are gets on a single index in a single store on a database.

Gets are blazing fast in IndexedDB. The issue with IDB at scale is typically writes.

One thousand success callbacks, one complete callback, were sub-second:

enter image description here

Ten thousand success callbacks, one complete callback, was about 5 seconds:

enter image description here

More than fifty thousand success callbacks fired in less than a minute:

enter image description here

Writes are much slower - bursty at first, but then slow after minutes and dog slow after hours. That's with any schema, but you'd likely have multiple indexes on location (both latitude and longitude at least, I imagine) so your writes will be especially slow (more indexes, more work to do to main those in inserts and updates).

Layout for the stats above (just as important as the stats themselves, make sure to design your schema according to how you need to access it):

enter image description hereenter image description hereenter image description here


I would go with direct database access and then monitor the performance and then optimize where noteable gains are to be expected. Premature optimization is seldom a good idea.