Hi again!
I hope you're having a great day. We are nearing the completion of our e-commerce website and have come across a fairly standard edge case that we should have detected earlier. I'm particularly interested in understanding how to handle potential conflicts when multiple customers attempt to purchase the same limited stock product.
Our current thinking involves implementing (one of) the following strategies:
1. Reserve stock for a limited time and if purchase is not completed, release stock. For the potential edge case that two users still try and checkout simultaneously, use race conditions to allow first user to successfully checkout.
2. Real-Time Inventory Updates: We are exploring options like web sockets or AJAX polling to achieve real-time communication
3. Notifications: Depending upon whether or not we use solution 1 or 2 above, we will use standard notifications regarding the exhaustion of stock. (Likely at checkout). In the case of the real time inventory solutions, we are interested in hearing from anyone that has experience dealing with notifications throughout the shopping experience (for example, using dynamic scarcity measurements, real time notifications on product sliders, list and details pages, etc.).
I would greatly appreciate insights from those who have dealt with similar scenarios. What approaches did you take to manage limited stock effectively? I'm open to alternative solutions or any advice you can provide. Thanks!
Best regards,
Ben