Question

I have the following database layout:

AppName (db) > Fruits > Apples > Fuji Apple (table)

Is there a way to create a sub-level called "apples?"

For instance:

objectStore = db.createObjectStore('fruits', {});

Now within fruits, I want another level called apples.

I could structure it so that the database is called "Fruits," but then I would have to open multiple databases for my application. Multiple instances of a database are not good in back-end languages but maybe Javascript is different?

Was it helpful?

Solution

I also use multiple database for storing the data, however my use case is to access data from one database at given time. So if your data are not connected and you don't need to list them all in one place I suggest you to create multiple database for your data.

There is a huge speed improvement if you store your data in multiple database compared to storing everything at one place.

TLDR: If you don't need to show the data in one place you should separate them into multiple databases.


Update: If you do need all items to be shown at once than you can sort them out with indexes for increased performance when you need the specific set or subset of items.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top