SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast webburu's Avatar
    Join Date
    Mar 2008
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how do you model the "recurring task" database?

    I wonder what is the best way to model the task management? Let's say we have task(id,title,startdate,enddate...) and we also have recurring tasks which could be daily, weekly,monthly and these recurring tasks happens in a period of time?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    are you sure that daily, weekly, monthly are the ~only~ recurrences you want to model?

    what about every second tuesday? the fourth thursday of every month? etc.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast webburu's Avatar
    Join Date
    Mar 2008
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    are you sure that daily, weekly, monthly are the ~only~ recurrences you want to model?

    what about every second tuesday? the fourth thursday of every month? etc.
    I think that complicated enough I think I need to model. I am trying to find the best models in terms of performance when I retrieve the data. Thanks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To me it doesn't seem a database problem. The easy thing is to store the tasks (and i would be generic for that purpose, perhaps use crontab as example); the complicated issue is to design the process which will coordinate the tasks. This process has to know when to start a new task, ideally by sleeping in between tasks instead of polling the database.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •