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.
Keep it simple -- how often do you need to send the emails? One a day, once an hour, after you update your stock items. Just check periodically.<p>Do you want to consolidate emails if a user had multiple alerts?