Store data in Ruby on Rails without Database
Posted
by snowmaninthesun
on Stack Overflow
See other posts from Stack Overflow
or by snowmaninthesun
Published on 2010-05-04T14:45:39Z
Indexed on
2010/05/04
14:48 UTC
Read the original article
Hit count: 176
I have a few data values that I need to store on my rails app and wanted to know if there are any alternatives to creating a database table just to do this simple task.
Background: I'm writing some analytics and dashboard tools for my ruby on rails app and i'm hoping to speed up the dashboard by caching results that will never change. Right now I pull all users for the last 30 days, and re arange them so I can see the number of new users per day. It works great but takes quite a long time, in reality I should only need to calculate the most recent day and just store the rest of the array somewhere else.
Where is the best way to store this array?
Creating a database table seems a bit overkill, and i'm not sure that global variables are the correct answer. Is there a best practice for persisting data like this?
If anyone has done anything like this before let me know what you did and how it turned out.
© Stack Overflow or respective owner