I have a calendar system in my web app. We need to implement reminders.
Are there any reminder/alert patterns or system designs, or best practices? If so or if not, what might be some ways of achieving this?
Design Considerations
So far my design is something like this:
But maybe there are more elegant patterns than this? Something already established? Or some tool in azure etc.?
Our stack is .net and azure.
Create a table for the next day. Add a trigger to add the reminder upon insertion into the main table and a trigger(if it is the same day, to verify the job is scheduled for that 10 minute increment and add it to the daily table, same for the removal of the reminder.)
Batch a job each day at off peak times to place reminders for the next day and schedule the jobs to run at the appropriate times. If they are removed before the batch runs they are never added; if after, the trigger will remove them.
Use your existing script, as scheduled by the batch scripts and triggers, to send notifications based on the much smaller daily table.
This process will minimize the execution time overall, while using minimally more database space.
Edit: While the suggested process is an improvement on the original algorithm, whether or not this will translate into financial savings on the Azure platform cannot be determined without usage data.
With light usage: This will improve performance by eliminating full table queries and eliminating the jobs every 10 minutes when not required, at the expense of a few MB of additional storage.
At large to hyper-scale solutions: The batching and triggers will improve efficiency by eliminating full-table scans during the 10 minute queries.
In the middle, it is 50/50 to your proposed solution.
Where those exact boundaries lie, I cannot say without more data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With