Here's the test scenario, I have multiple asynchronous requests in a JavaScript Application that:
- creates an object and saves it in the database.
- queries that object and make changes to it and saves it to the database (this step is done 2 or 3 times to add new items to the object)
steps 1 and 2 are repeated for every new object, for a long test scenario.
Upon investigation, it turns out some selects and inserts are taking up to 11 seconds, and more over time, which is probably expected when you are doing that many inserts for the same table, and each insert has to wait for the other one to be finished.
My question is, how to mitigate this issue or maybe even get rid of it without losing its asynchronous ability?
I know a multi-value insert is much faster than a single one, but how would you do such a thing in an asynchronous application?