Thanks for your question, from the horses mouth
IndexedDB is a way for you to persistently store data inside a
user's browser. Because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline. IndexedDB is useful for applications that store a large amount of data (for example, a catalog of DVDs in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads).
IndexedDB lets you store and retrieve objects that are indexed with a "key." All changes that you make to the database happen within transactions. Like most web storage solutions, IndexedDB follows a
same-origin policy. So while you can access stored data within a domain,
you cannot access data across different domains.
So
A1. Yes, it can be used by clients, but on a same domain, as the data is stored on the client browser, other users CANNOT access it unless you sync it to some other back-end. Multiple tabs on the same browser can access it though but they will have to sync data in some way I guess.
Usually, when your app starts, it creates the DB on the
user browser space including the tables etc if they dont exist. With BANano this is through BANanoSQL aka
AlaSQL
A2. Multiple users cannot access the IndexedDB on your browser. (As explained in Q1 above)
As the browser can "delete" your data when it sees fit / automatic eviction or when you clear browser data, usually the best option is to use
CouchDB, which is an indexedDB with sync functionality.
For example, you can use IndexedDB for offline use and then sync data to PocketBase, MySQL or other databases. In my examples, the use of IndexedDB is just for demonstration and not for fully fledged apps due to the examples not having any sync functionality. For the LowCode tool, I have now added a download functionality so that one can download their projects & upload them. This acts as a manual backup/restore kinda functionality.
Yes, one can tell the browser not to evict your DB by using the storage api. One can also add functionality on their app to check if your db is empty when the app starts for example.
Overall, using IndexedDB without sync functionality is a risky proposition.
I hope that helps.