How do online stores handle 2 customers that add the last item to their cart?

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2012-12-16T17:01:36Z Indexed on 2012/12/16 17:03 UTC
Read the original article Hit count: 158

Filed under:
|

I'm making a store web app for a college class. I'm wondering what do stores like Amazon do when there is only 1 item left?

Do they let multiple customers add the last item to their cart, and whoever checks out first gets it? Meaning that the inventory database is updated after purchase.

or

Do they let only one customer add the last item to their cart and remove the item from the inventory. If the customer's session times out, then the item is put back in the inventory.

© Stack Overflow or respective owner

Related posts about database

Related posts about web-applications