On 22 April 2010 11:58, Pieter Hugo <[email protected]> wrote: > Hi Sijo > > Thanks for the info - I will look in to the @@ idea > >>>In any case the data needs to be visible >>> 'between' sessions as well. >> >> But this needs the data to be stored in D B it self. Is it? > > Yes - The data is currently in a table in the database - it is a table > of rights users have under different conditions. These rights wont > change for weeks on end, so reading them from the database every time > the user tries to do something is silly. I want these rights to be kept > in the memory of the server all the time. In other words - when the web > server is started - get the rights from the database and keep them in > memory forever (or until the server is restarted) Whenever a request > comes in from a user - check the right against memory instead of against > the database.
I would not go for this sort of optimisation unless you know that you have a performance issue. It may seem unnecessary to access the db each time but the data will be cached by the db server so the overhead should be minimal. It is most unlikely that this will turn out to be a significant part of your request turnaround time. Colin -- 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.

