[thelist] Doing things just once -- tracking in database.

Bill Moseley moseley at hank.org
Tue May 26 13:19:48 CDT 2009

I have an "account" table with a date column "end_date" that indicates
when the account expires.

I need to send out email to accounts that are about to expire.  I want
to be able to track which accounts have been sent the email.

One simple solution is to have an additional boolean column on the
account table "reminder_email_sent", but that does not seem very
scalable as more and more events will need to be tracked.

I'm leaning toward an event table with columns "account_id",
"event_id", and "processed_time" so that for any event I can find
accounts that may be ready for the event (e.g. find all accounts
that will expire in less than 10 days and do not have a row in the
event table for the event within, say, the last 30 days).

Does this seem like a sane approach?  Obviously, this is a common
task for applications so I'm wondering if there are better solutions.

Do you use a table to track processing events?  What columns do you
include in that table?

Thanks for your input,

Bill Moseley
moseley at hank.org
Sent from my iMutt

More information about the thelist mailing list