Ruby Forum Ruby on Rails > memcached vs. activerecord

Posted by Grayson Piercee (grayson)
on 21.03.2008 23:45
I know I'm inviting the full wrath of a lot of purists but I thought I'd
ask anyway.  Is there a way to store a model (activerecord based one)
straight into memcached and skip the database all together?

Basically I'd like to make a bunch of web service calls, instantiate
some objects from the results (like :user, :user_interests,
:user_friends, etc based on the normal Rails associations) write it to
memcache and read it back

Let the thrashing begin ....

GP
Posted by Jason Roelofs (Guest)
on 21.03.2008 23:52
(Received via mailing list)
It's not a guaranteed storage area. If that's fine, then I see no
problem with it.

Jason

On Fri, Mar 21, 2008 at 6:45 PM, Grayson Piercee
Posted by Matthew Isleb (misleb)
on 22.03.2008 00:17
Grayson Piercee wrote:
> I know I'm inviting the full wrath of a lot of purists but I thought I'd
> ask anyway.  Is there a way to store a model (activerecord based one)
> straight into memcached and skip the database all together?
> 
> Basically I'd like to make a bunch of web service calls, instantiate
> some objects from the results (like :user, :user_interests,
> :user_friends, etc based on the normal Rails associations) write it to
> memcache and read it back

So where do you get the data from? How do the models know what 
attributes they have? How long does this data need to persist?

=matthew
Posted by Grayson Piercee (grayson)
on 22.03.2008 16:01
Cool, not the question is how?  Do I create some non-ActiveRecord 
classes, load the web service results into those, put them into an array 
and give it to memcached?

Thanks,

GP
Jason Roelofs wrote:
> It's not a guaranteed storage area. If that's fine, then I see no
> problem with it.
> 
> Jason
> 
> On Fri, Mar 21, 2008 at 6:45 PM, Grayson Piercee