# MemoryStore vs Class Variables

**URL:** <https://www.ruby-forum.com/t/memorystore-vs-class-variables/165140>\
**Category:** Rails\
**Created:** [April 9, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/memorystore-vs-class-variables/165140 "2009-04-09T13:50:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sshaikh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b77776/32.png) [@sshaikh](https://www.ruby-forum.com/u/sshaikh)\
**Post date:** [April 9, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/memorystore-vs-class-variables/165140/1 "2009-04-09T13:50:08Z")

</div>

Apart from the possibility of changing the Store of the Rails’ cache  
without much code modification, what’s the benefit of using a  
MemoryStore backed cache over class variables to cache models?

Excuse the contrived question, I’m just trying to work out the best way  
to cache some data.
