'Scalable event scheduler for possibly hundreds of thousands of events
I am trying to build a restaurant reservation application. A user can reserve a table in a restaurant ahead of time and will get a reminder 30 minutes prior. I am planning to use AWS SNS for sending the reminders. I am aware of AWS EventBridge rules, but it has a limitation of 300 rules per bus and 100 event buses per account. That makes a total of 30000 rules at any given time. A workaround can be a polling worker, which keep on querying a DB for events very 'n' seconds. Is there any event based mechanism other than AWS EventBridge which supports hundreds of thousands of events or is polling based implementation the only way forward ?
Thanks
Solution 1:[1]
I ended up using polling based approach. I used a t2 small EC2 instance and 2 SQS Queues. All events scheduled are pushed to an input SQS queue. A listener ( python script ) that runs on the EC2 polls the queue every 1 minute. Once an incoming event schedule is detected, it is pushed to a local SQLite DB, where event's scheduled time is indexed. The EC2 listener also polls the DB every one minute to check for events that needs to be triggered. The event is then put into the second SQS queue and a lambda function is added to trigger on SQS.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Vinayak |