0

I am curious how to setup both mongodb and redis for a single rails3 app? I googled but nothing found. any good idea? Thanks.

2
  • sorry, but what is the problem with this? Commented Apr 18, 2011 at 16:35
  • MongoDB and Redis are different data storage engines. In general, an application writes to a single data storage engine. What exactly are you trying to do? Write all data to both? Write some data to one and some data to the other? Commented Apr 18, 2011 at 23:37

2 Answers 2

1

Both mongo and redis have excellent ruby clients that can be used within rails3. You could create a rails project excluding the creation of activerecord and simply use instances of models created with either the mongo or redis client. I have actually used ohm for something similar for redis with rails and highly recommend it.

Sign up to request clarification or add additional context in comments.

Comments

0

For setting up Mongo with Rails, take a look at MongoMapper. MongoDB got a great guide on MongoMapper and Rails aswell. When creating a Rails project, just remember not to include ActiveRecord. You can do that with the rails new my_app --skip-active-record switch. This is all mentioned in the guide, you should give it a read.

For Redis, I'm not sure what your use case is. Most common ones for Rails are things like Resque. You should first take a look at the Redis.io website. Then take a look at the redis-rb Ruby gem, it's really quite simple.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.