implementing a notification list

Steve Davis <>
Thu Mar 18 16:37:52 CET 2010

HI Martin,

A couple of approaches to consider for a starting point:

1) If appropriate you could use the timestamp as the key on your
db_event record, i.e. -record(db_event, {timestamp, data, ...})
2) If using the timestamp as the key isn't appropriate, you can index
the timestamp field,


On Mar 18, 6:34 am, Martin DeMello <> wrote:
> I'm new to Erlang, and having a bit of trouble coming up with the
> right way to do this:
> I have a set of mnesia triggers that watch for various db events. I
> now want to have a persistent notification list that supports the
> following two operations efficiently:
> 1. insert a new event, with timestamp
> 2. retrieve all events between two given timestamps
> and possibly less efficiently
> 3. compact the table (combine several updates to a single object into
> a single row)
> This post
> seems to imply that simply storing the notifications as an mnesia
> table is a bad idea.
> martin
> ________________________________________________________________
> erlang-questions (at) mailing list.
> See
> To unsubscribe; mailto:

More information about the erlang-questions mailing list