Creating an email notification system based on polling database rows

Posted by Ashish Sharma on Programmers See other posts from Programmers or by Ashish Sharma
Published on 2013-07-03T08:19:08Z Indexed on 2013/07/03 11:16 UTC
Read the original article Hit count: 584

Filed under:
|
|
|
|

I have to design an email notification system based on the following requirements:

  1. The email notifications would be created based on polling rows in a Mysql 5.5 DB table when they are in a particular 'Completed' state.

  2. The email notification should be sent out in no more than 5 minutes from the time the row was created in the DB table (At the time of DB table row creation the state of the row might not be 'Completed').

  3. Once 5 minutes for the DB table row expire in reaching the 'Completed' state, separate email notification need to be sent (basically telling the user that the original email notification would be delayed) and then sending the email notification as and when the row state reaches to being 'Completed'.

The rest of the system requirements are :

  1. Adding relevant checks to monitor the whole system via MBeans interface.
  2. The system should be scalable so that if the rate of DB table rows creation increases so does the Email notification system be able to ramp up.

So I request suggestions on following lines:

  1. What approach should I take in solving the problem described from a programming/Design pattern point of view?

  2. Suggestion for any third party plugin/software that can be used to solve the problem described?

  3. Points to take care regarding scalability and monitoring the health of the system?

Java is the language of preference but I am open to using off the shelf components that can be interfaced with Java language or provide standard ports for communication.

Currently I do have an in house grown system (written in Java) that is catering to the specified requirements, but it's now crumbling under increased load and now I want to give the problem a fresh look.

thanks in advance

Ashish

© Programmers or respective owner

Related posts about mysql

Related posts about scalability