Not to sure if this is the right place to ask this.
But I have more of a Theory Related question then Completely Technical
I want to Propose my Issue at hand and then I'm looking for someone to give me a fresh mind on this and an Alternative way id be able to handle this
So I have this Mobile Ecom application everyone's happy with the application the only complaint has been that the checkout "Placing the Order" Take's to long 30ish Items take around 20/30 Seconds, 1 Item around 3/5
I know why this is, But the issue is I can't Do to much about it. Its a Initial Design flaw on my part.
So essentially When the items are in the cart and they get checked out 2 Things happen 1.I pull that Item from The API backend and then Check that Pulled item A against the Item in the Cart B
So if A has less stock then B then you can't checkout B as an example, Then If all checks out then B is added to a orderline list and Placed in a Order Call.
Now the actual order call for B Takes 1/2 Seconds per instance of B, However Getting A to check against B Take's 2-4ish Seconds Per instance of B, Now from that you can conclude that The more items the Longer A make's this process, But how els do I do this? I have to cater for the fact that Person X and Person Z want Product B(Product being a Can Of paint) Now Person X Adds 10 Of B to the Cart And person Z add's 20 But there are only 25 of B
So Now Person X adds B to cart and keeps shopping While Person Z Adds B and checks out immediately Now person X Adds another item and decides to Checkout But now He requires 10 But theres only 5 left, So Now I need to know that Theres only 5 Left at that Instance.
So How els besides getting another product A to compare against Would I go about this kind of thing?
Small Note before getting asked this i've done what I can or from what my Skill level allows to the API(Not my own) to try and Improve these times