Ruby on Rails
Thursday, April 28, 2011
On Thu, Apr 28, 2011 at 1:55 PM, egervari <ken.egervari@gmail.com> wrote:
-- There's some really interesting approaches in all of these emails.
I like this one the best. I haven't learned how to setup 2 databases
in rails... but is this complicated to do? I guess I could make a
database just like this person is doing, put all the thesaurus lookups
in it, and then keep it running just like any other database.
I want to avoid doing a ruby<->java bridge if I can. The last thing I
want is some bloated java process needing 512 megabytes of ram just to
do its think without throwing some kind of out of permgem space or out
of memory errors :/ At least if it's all in rails, I can just dedicate
all of extra ram to rails and my database.
Are the in-memory databases fairly quickly, such as sqlite? I've not
used it mysql. If it can take do at least 1000 individual select
statements very quickly (like less than a second), then that could
work.
If a thesaurus is just a grouping of words then you can use memcached, is a shared key value store, fast and is integrated to rails, you can do Rails.cache.fetch(word){ Words.thesaurus(word) } and the first time it will hit the db write the result to memcached and there after it will pull it from memcached. Memcached can be clustered and the key are shared among the servers.
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment