For my IndexedDB I'm pulling various Ajax requests that will provide the data to the objectStores.
Since transactions are asynchronous how should I chain the creation of the objectStores?
I'm thinking in doing it like this:

1- Pull all the Ajax requests in the beginning of the script.

2- Request to open the DB.

3- In the onsuccess handler open the first transaction to create the first objectStore and insert the respective data.

4- Call the oncomplete event on the first transaction to create a second transaction.

5- Do this for all the objectStores that need to be created.

Is this the best way, or should I just write all the transactions inside the onsuccess handler of the indexedDB.open request?

Can I create various objectStores and insert large amounts of data at the same time without causing errors?