Forum: Ruby on Rails Preloading models in Rails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Richard (Guest)
on 2006-05-16 20:06

I'm fairly new to rails and I need some advice on best practice. I'm
working on an application that has a calendar section (I know, not
another one of those!) and I was wondering, when is it best to query
your database and when is it best to preload a model. In the calendar
app the user will have a month view of entries and was wondering should
I preload all the entries of the month or should I just query the
database whenever the user wants something. I want to preload but I'm
not sure whether it is worth it considering I'm only envisaging a couple
thousand users.

And one more thing, are preloaded models held in the database or on

Thanks in advance,
This topic is locked and can not be replied to.