Its likely that Big Sites keep their detailed IP private; its unlikely that you are working on such a site.
Aldian is correct that there are many strategies, or combination of strategies you could use, and the exact one really does depend on the team's skills and choices of technologies. One idea could be to use a key-value store such as Redis, which is fairly fast (see https://redis.io/topics/benchmarks but especially see "Pitfalls and misconceptions" to get some appreciation that real world problems are not at all trivial and most answers start with "it depends..."). You can use product ID as the key, linked to a pair of "current DB available; current total In-carts" values. This would make lookups quick and you only need DB access/change when, as you say, an actual transaction is concluded. This is just a possibility; and one of many you could employ. Derek On Sunday, 19 July 2020 13:18:15 UTC+2, tristant wrote: > > 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, > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e4c7ccb3-1cfb-47ae-8b3d-3d351b1c2b25o%40googlegroups.com.