help modeling a schedule system

Поиск
Список
Период
Сортировка
От chris h
Тема help modeling a schedule system
Дата
Msg-id AANLkTinazJ_aiYbpe0CbkhsbZ11rhSNR48Cd3WvkKNq0@mail.gmail.com
обсуждение исходный текст
Ответы Re: help modeling a schedule system  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
I'm not sure if this is the correct list for this, but I'm hoping to get some help with a data model I'm struggling with.  Let me know if this should be elsewhere! :)


We have an event schedule system that basically tells an event handler when an event should be fired, and keeps a history of fired events.  An event would only be fired once per day, and can have the following settings.

a) Time of day (granularity of minutes, we're not worried about seconds):
e.g. 09:34, 17:00, etc.

b) Day of week (an event can be fired or not fired any/all days of the week):
e.g. sun-sat; mon-fri; mon,wed,thr; mon; etc.

c) Ratio in fired-event-days to all-event-days (an event may only fire on some of the days that it is suppose to):
e.g. 1:2 - would fire every other day, 1:1 would fire every day, etc.

d) Exceptions (events can have periods of set inactivity):
e.g. 20110201-20110210 would disable the event from February 1st, 2011 through February 10th, 2011, after which it would resume as normal.

note: we are expecting number of events to be in the 10's of thousands, but I would like a solution that can easily scale into the few millions.


The models I've come up with to satisfy these requirements seem bloated and overly complex to me.  Having these events fire, on-time, is the biggest priority here.  By having a complex, temporal system the probability of logic errors seems to be high; I want to avoid that.

Thanks for any help everyone!

Chris H.

В списке pgsql-general по дате отправления:

Предыдущее
От: Selena Deckelmann
Дата:
Сообщение: Submissions for a PostgreSQL track at MySQL Conf 2011: Due October 25
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: help modeling a schedule system