I want to design a back in stock notification email service, where the users can sign up on the out-of-stock page and get notified when the item is back in stock.
If I have the list of users subscribed to back in stock alert and another table that has latest stock availability, what would be the best appraoch to build an efficient system that looks at these data and trigger back in stock email ?
- Do I poll the stock table for change in stock and then compare with user table and trigger email ?
- Is there any other better ways of doing it ? Is there any design patterns/ specific tools/ constructs to solve such problems ? I am gravitating towards as event driven model - but not sure what to look out for this problem statement.
I am not looking for a complete solution, but opinions/ pointers to any resource would be greatly appreciated.
Ask HN: How to design a back in stock notification system? | Better HN
Email has to be triggered once an hour since the items are fast moving. There is no need to consolidate multiple emails into one.
We have around 50k products and stock levels are at fullfillment location level(100+ locations). We capture the zip code of the user as well so as to trigger email if the item is back at fullfillment location near to him.