I’m learning how to use Firebase in order to develop an e-commerce website. I’m just curious as to how concurrency is solved. Let’s say two users, at the same time, attempt to add a product (that has only one item in inventory) to their cart respectively.
Beyond the technicalities on how to implement different solutions, I’m concerned about user experience. What solutions are generally accepted and why?
The thing that ocurred to me is some sort of a “lock”. Basically the user that first sends the requests locks it and has like 5min to complete the purchase. After those 5min the lock is released. I had no trouble implemnting that though. I’m curious about other solutions.
Sseus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.