I''m looking at an application that has 30+ lookup tables. By that I mean your typical (id, description, created_on) affairs that contain locations, zip codes, contract types and what not. Things that rarely change, and are maintained by administrators. It''s well known that when you have many lookup tables in the schema, eager loading is not good enough anymore, and you need to cache them in memory as ready-made objects, to avoid abusing the database. Looking for an available Rails solution I came across http://dev.robotcoop.com/Libraries/cached_model/classes/CachedModel.html Is it the good way to do this? Are there other choices worth looking at? Should we roll our own? NB: Yes, I know about ActiveRecord:Base.cache(), and it doesn''t solve this problem, not in our case. -- Alexey Verkhovsky CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] RubyWorks [http://rubyworks.thoughtworks.com] --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2007-Aug-14 11:28 UTC
Re: What''s the good way to cache reference data?
Alexey Verkhovsky wrote:> I''m looking at an application that has 30+ lookup tables. By that I > mean your typical (id, description, created_on) affairs that contain > locations, zip codes, contract types and what not. Things that rarely > change, and are maintained by administrators. > > It''s well known that when you have many lookup tables in the schema, > eager loading is not good enough anymore, and you need to cache them > in memory as ready-made objects, to avoid abusing the database. > > Looking for an available Rails solution I came across > http://dev.robotcoop.com/Libraries/cached_model/classes/CachedModel.html > > Is it the good way to do this? Are there other choices worth looking > at? Should we roll our own?For smallish tables that you want permanently and fully cached in memory I''d recommend: http://svn.protocool.com/public/plugins/enumerations_mixin/ -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---