Forum: Ruby on Rails The New Memcache ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-01-20 23:41
(Received via mailing list)
Hey All !

I ended up browsing to Eric Hodel's blog the other night, and found his
entry about the new cache_model and memcache-client.
Now, it looks like it's "officially" out in the open:
http://weblog.rubyonrails.com/articles/2006/01/20/...

In my application, I've been staying away from caching my models, and
instead just doing lookups based on different ID's that I pass around.
I
heard that this was a good practice, as your sessioned models could
become
inconsisent (ie:  if it was updated).

Now, it looks like this may be a moot point, as the cache_model
implements
ActiveRecord::Locking, and the memcache-client solves some performance
issues.
Is this the case ?

It would indeed be *much* easier to store some models in the session,
than
to do lookups all over the place, so was just wondering what other
people
think.
Let me know what you think, and forgive my ignorance if I any of my
statements above are incorrect :)
==
Dylan
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-01-21 22:53
(Received via mailing list)
On Jan 20, 2006, at 2:01 PM, Dylan Stamat wrote:

> I ended up browsing to Eric Hodel's blog the other night, and found
> his entry about the new cache_model and memcache-client.

I don't have a blog yet ;)  Its the company's blog.

> implements ActiveRecord::Locking, and the memcache-client solves
> some performance issues.
> Is this the case ?

You need to add the lock_version columns to your tables if you don't
want nasty surprises in your database:

   Active Records support optimistic locking if the field
lock_version is present.

-- http://api.rubyonrails.com/classes/ActiveRecord/Locking.html

> It would indeed be *much* easier to store some models in the
> session, than to do lookups all over the place, so was just
> wondering what other people think.
> Let me know what you think, and forgive my ignorance if I any of my
> statements above are incorrect :)

Just store the id of the model in the session and let cached_model
take care of the rest of it.  No sense storing the model in memcached
twice.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-01-25 19:07
(Received via mailing list)
Ahh... thanks for clearing up some of the confusion I had Eric :)
This topic is locked and can not be replied to.