title: How to design a Real Time Alerting System?
body: <p>I have an requirement where I have to send the alerts when the record in db is not updated/changed for specified intervals. For example, if the received purchase order doesn't processed within one hour, the reminder should be sent to the delivery manager.</p>
  
  <p>The reminder/alert should sent exactly at the interval (including seconds). If the last modified time is 13:55:45 means, the alert should be triggered 14:55:45. There could be million rows needs to be tracked.</p>
  
  <p>The simple approach could be implementing a custom scheduler and all the records will registered with it. But should  poll the database to look for the change every second and it will lead to performance problem. </p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>Another basic approach would be a creating a thread for each record and put it on sleep for 1 hour (or) Use some queuing concept which has timeout. But still it has performance problems</p>
  
  <p>Any thoughts on better approach to implement the same?</p>