1

I spent last couple of hours searching the web for this solution and I didn't find any, so I wanted to ask here if anyone has experience with something like this.

I started working on a very big Rails project and I've got some very strange request from the project manager.

He wants me to use 2 different MySQL databases for different environments (which I already found how to do here

Apart from this he wants to make a small local database which would serve as an autosave vault for the recent documents (maybe 5-10 recent documents) and he wants this database to be a SQLite.

Since I just started with the Rails recently I didn't even know if this sort of connection is possible, and is something like this even possible in Rails.

I also thought of using a Connection Pool to ensure thread safety.

Any advice and help is appreciated.

Community
  • 1
  • 1
mutantkeyboard
  • 1,614
  • 1
  • 16
  • 44
  • 1
    it should be possible yes. Are the 2 MySql databases completely different things, or are the contents of them similar to the point where you would dynamically select between the two? Is the local database taking the 5-10 most recent things gotten from either of the MySql databases? – Clark May 27 '15 at 19:16
  • 1
    Have you seen this [Blog Post](http://ilikestuffblog.com/2012/09/21/establishing-a-connection-to-a-non-default-database-in-rails-3-2-2/) while it is from 2012 the functionality and advice remains true. – engineersmnky May 27 '15 at 21:00
  • @Clark it should dynamically set between the two, and it's not taking any data from MySQL databases, but application should write directly into it (Though I don't know if it's a smart idea). Engineer - thank you for the tip, I haven't actually seen that blog post :) – mutantkeyboard Jun 03 '15 at 20:10
  • For a good place to start I would look at these answers. http://stackoverflow.com/questions/6808645/use-two-different-databases-in-one-project – C dot StrifeVII Oct 14 '16 at 18:32

0 Answers0