Hi,
I am wondering if anyone could point me to any documents or readings on how to big eCommerce sites such as Amazon or eBay implements the following situation:
- A seller posts a product with an initial quantity, 'init_qty'.
- An unknown number of clients access the product concurrently, add it to their shopping cart.
- The site needs to manage the contemporary available quantity, "avail_qty", and all times. And switch the product to "unavailable" if the quantity drop to zero.
- However, the effective "avail_qty" is only updated permanently in the database if and only if the client checks out and pays.
For small eCommerce sites, updating the database frequently is not a big deal. But if the product count and client count is large, what is the efficient way to implement this?
Thanks,