I've done work on NRT data, but I'm not the one who's responsible for generating alerts on the matter.
A few things that you might want to consider:
- I don't know how the entries get into your database, but rather than query against a growing table, you may be able to set up a trigger that logs to a second table that you can grab everything from every 3 minutes and then clear in that same transaction.
- Depending on the database, the trigger itself might be able to generate e-mail or send some other signal for the e-mail to go out. (if using Postgres, there's PL/pgSQL, but there's something you have to do first to allow access to all perl functions). But if you can get it to export anything to an external file, you can have a daemon sit and poll for that file so you don't beat on the database.
- The astronomy community has the Gamma-ray Coordinates Network to distribute even information in (near?) real time.
- In Earth science, there's the Volcano Notification Service. I suspect that there would be other warning systems for critical weather events that are more push-like. (all that I know about is the NWS, which is a pull)
- Distributing NRT solar data just came up yesterday on the code4solar mailing list. (because I brought it up), but it's for the data for re-analysis so lags by a good 15 minutes. The event detection info gets pumped into the Heliophysics Event Knowledgebase.