On Tue, Oct 21, 2008 at 8:36 PM, Bharat <[EMAIL PROTECTED]> wrote:
>
> Jeff,
> A few pointers since I am maintaining and enhancing a rather large
> application with similar functionality.  It seems to work well (most
> of the times):
>
> I am firing an SQL query every minute to check for reminders instead
> of 15 minutes so the actual query is not an issue.  Its construction
> is:  you may want to create a separate table called "reminders" (or
> something similar) which stores reminders records for only those users
> who want them.  That way if majority of your users do not use this
> functionality, you are not incurring an unnecessary overhead.  This
> table will have an id as every rails table does and will have an index
> on id.  It should also have the foreign keys, at least for the users
> (user_id), make sure that it is indexed as well since you will be
> joining reminders and users table based on this foreign key.  You can
> have other foreign keys as well, for example, event_id if the
> reminders are for particular events.  That is how one to many
> relationship works.  You may want to refer to any of the online
> tutorials available on basic database design which is a prerequisite
> to making good rails applications.
>
> The scheduling of these recurring tasks is also important.  You want
> to use a cron style scheduler that does not load the rails environment
> every time the task is run.  If you use the unix/linux cron to
> schedule a rails runner, it will load rails environment everytime you
> call the task which is a very slow and demanding process.  My
> application uses Backgroundrb.  I am looking for alternatives which
> are simpler, easier to debug, and more reliable.

Can you file a bug report with a reliable way to reproduce them? I am
sure, we can iron it out.


>
> The point of all this is that you are not taking on a trivial task,
> rather a substantial one if you want to better architect your
> application so you may want to think through it carefully.  Having
> said that, you are thinking of the right things.  May be you want to
> experiment with a prototype which is not in your critical path?
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to