0

I'm new to using IndexedDB. Currently I am writing a small vocabulary learning app and I want it to remember the progress offline.

IndexedDB emphasises that everything gets done in a separate thread. That was already a steep learning curve to deal with.

Now I am wondering: How much to I have to look out for recources when working with the IndexedDB connection? Since the DB is on the local box in the same browser I wonder:

Is there a connection limit? Is there a connection timeout? Should I bundle Queries or can I do lots of small interactions with IndexedDB?

To clarify the last question: If I have a Quiz with 10 Questions. Can I just communicate with the DB after every single answer (possibly just using a new connection every time) or am I supposed to use this more in way where I grab all the data I will need from the DB and then deal with it in my script?

Maybe IndexedDB is a bit overkill for what I'm doing, but I just want to learn about it.

JasonTS
  • 2,479
  • 4
  • 32
  • 48
  • 1
    My educated guess: you don't have to worry, no connection limit, no timeout, small queries are okay. You might want to use the same connection/instance though. – AKX Oct 13 '22 at 14:29
  • That's what the docs are for https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB – morganney Oct 13 '22 at 14:33
  • I highly recommend Jake Archibald's `idb` wrapper library. It lets you use it with Promises instead of event listeners and callbacks. – Darryl Noakes Oct 13 '22 at 14:46

0 Answers0