Hi,

I am new to Rails and I am building a rails server which acts as the
backend for a mobile app. I have certain daemon processes that fetch and
store data in a database. Every time someone makes a request for data
from the phone, I will have to send him the same dataset irrespective of
who is requesting the data.

This dataset will keep changing quite frequently and my daemons will
keep updating the database accordingly. Since the same data is to be
sent to every one, I am assuming that it would be best to cache the data
on the server and keep updating the cache at a set frequency (thus
making only one trip to the db). When I get a request from the phone, I
just retrieve this cached dataset and send it back, w/o hitting the db.

I think one way of doing this would be to use a singleton model class
which will cache the data and this would act as the source. Is this the
best way to go about this process? Does Rails provide some other means
of doing this?

Thanks,

Ramkumar.

-- 
Posted via http://www.ruby-forum.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 [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