• Post Reply Bookmark Topic Watch Topic
  • New Topic

How should I design an alert system which sends messages to users based on their data in the DB

 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I have to make an alerts system which looks through data for users and sends them alerts based on the data.
A typical example of my alerts is a certificate uploaded getting after 30 days.
I have to alert the user to get the certificate renewed within 20 days.

If he does not, I remind him again.

I know quartz and know its very efficient in scheduling tasks.

But my problem is that I have buge amount of data.
Around 40K users in an average case with 8-10 tables each.


If there are 10 alerts active.. each has 3 conditions in it on some field in some field...
How do I optimize the data lookup ?

I can not make it event based since alerts are data based.. nothing triggers them

I see a possibility if keeping some fast access metadata, but m not sure what technology can help. And since data would be the same.. how would it help.
Somebody suggested Lucene search.. I'll go through it and see if it suits my requirement.

I am not aware of advanced searching techniques.. any suggestion is welcome



 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How complex are the "business rules" which decide when to send an alert? Would you need something like JESS? Or do you just need a list of users whose certificate expires on a certain date.

2. What process modifies the database/

Bill


 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A user profile has many parts, each related to a table in the DB.
Alert can be sent to almost any field from any of the part.

Data is created from UI and through upload using a CVS/txt file.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, sounds like complex business rules so something like JESS is in order. JESS would let you state the rules in a convenient format, MUCH easier than trying to write Java methods to cover all possibilities.

However, it seems to me that there is no need to constantly crawl the entire database if you can have the update process produce a list of changed entries.

Bill
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aniruddh Joshi wrote:Around 40K users in an average case with 8-10 tables each

So you have 400K tables in your database? Then you should really rethink your database design and normalize it.
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me correct myself.
Its not 8-10 tables each user, its entries in 8 - 10 tables.

i.e. 8-10 tables in all.

And DB updates would not help as the system is not completely event driven.
An example of the requirement is a user's birthday approaching in a month, his driving license expiring in 2 months etc.

I think I would either need to crawl the DB or store these values in a separate memory / location for this specific purpose.
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:OK, sounds like complex business rules so something like JESS is in order. JESS would let you state the rules in a convenient format, MUCH easier than trying to write Java methods to cover all possibilities.


I saw the JESS link you shared. Looks like JBOSS drools I am using for another requirement.
Am I correct ?


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I have not looked at Drools in detail but apparently it is based on the same "Rete" algorithm as JESS so go with whatever you are comfortable with.

Personally I would try to find the tools with the clearest way of expressing the "business rules."

Let us know how it turns out.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!