Link to home
Start Free TrialLog in
Avatar of dgrafx
dgrafxFlag for United States of America

asked on

Email reminders from Events database table

OK so we have a calendar where on the front end a user can create an event with an optional email reminder.
The front end time selector increments by 5 minutes so all times are 12:00 - 12:05 - 12:10 etc and cannot be 12:03

My question is what is the best way to implement the reminders?
Query every 5 minutes?
Avatar of Najam Uddin
Najam Uddin
Flag of United States of America image

How much load you are expecting? Is small number of people, it is okay to go with 5 min query interval, if large having a job to process all logic, get results and put it in a table from where you just select will be good, if even more user, try utilizing in memory db (over kill probably)
Avatar of dgrafx

ASKER

well - I do want it to scale so that's why I wanted something better than an every 5 minute query.

when you say a job to process logic and insert to table - how would that work exactly?
I need to prepare for event edits where the time is changed and events deleted as well as new events so at what point do I query?

Thanks
SOLUTION
Avatar of Najam Uddin
Najam Uddin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgrafx

ASKER

where you say >> I simply meant anything that require processing for scheduling ,should go in separate job process <<
I have to ask - separate from what?
Separate from your application, you may have web application or windows application that takes input and displays alerts or calendar for event. You take raw data from application and submit as job to be processed to a separate job component. This component does all the processing like adjusting event date and time , preparing  event calendar, also if you have calendar for group of people you update that, In short all heavy processing is in separate process/component/service.
Avatar of dgrafx

ASKER

yes ok - normally I'd use a scheduled task.
And this task would run every 5 minutes and query for events that fit the criteria.
So that is why I asked this question - how could I do this better?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgrafx

ASKER

ste5an
I had considered something similar to this - whenever an event is created, edited or deleted then mirror that action in a table.

But what I'm wanting to know is how to go about the next step - the polling or querying
And I want to know about the actual sending of the mail - are you thinking database mail or ?
Just poll the table. This can be a SQL Server Agent job and database mail. But imho database mail is not really in sending mail at exact points in time.

But when you need more control over the e-mail sending process then I would consider writing my own Windows Services handing the polling and sending.
Avatar of dgrafx

ASKER

Let me say this:
I've been away due to a funeral and had the flu also

Now I'm back but here is where I'm at.
The last calendar app I wrote I used a scheduled task that ran every 5 minutes to query and send event emails.
Now - years later - I'm wanting to do something "better", if there is something feasible.
I should say the live site will be on shared hosting so writing windows services will not be possible.

Now that I'm back I am asking if the following meets with your approval
1. When event is created edited deleted then mirror that in the reminders table
2. Every 5 minutes will run the scheduled task that will query reminder table for events that are for the next time slot.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgrafx

ASKER

No not really - I kinda forgot about this question - plus the calendar app is on hold.
So I should wrap this question up ...