Hi all,
I have a calendar application( like Microsoft Outlook) writtn in
Java.Whenever an event is created, we can set SMS/EMAIL notification. Hence
when an event is created, I am storing that event info and notification time
into a database.Now the notification can be ranging from 5 minutes to say
one day.Hence I need to query the databse every 5 minutes and fetch the data
and do send the notification directly. I understand that such a querying of
database every 5 minutes is a huge performance penalty. Can any body please
suggest a better way to implement this? Any links please? Any patterns would
be of use? Thanks a lot for the help.
Regards,
Ravi
Neil Green - 18 Nov 2003 22:28 GMT
> I understand that such a querying of
> database every 5 minutes is a huge performance penalty.
Querying a database every five minutes is a minute performance hit.
Unless you need very fine granularity of timing or there are a huge
number of notifications to be sent, the method you've described sounds
like a perfectly reasonable way of handling it.
Regards
Neil
sjefens konto - 19 Nov 2003 11:48 GMT
> Hi all,
>
[quoted text clipped - 10 lines]
> Regards,
> Ravi
Another idea is to implement some sort of TimedEvent class, store all
timed events in a database for persistence, and use some sort of Vector
or other list as storage. Then you only need database access when
starting up the service if you fear performance degradation. This will
be in expence of memory, however.
I've done this as a VB Component, with a MS Access db for persistence,
and have the component to deliver events. Of course this can be done in
java as well.
Regards
tron