We have two RoR projects with some similar data in DB let's say DB "A"
and DB "B".
My task is to store all similar tables with data in one DB - the "C" DB,
plus remove unnecessary
tables from "A", "B".
I want to find the best way how to do it. The goal is to get the same or
better performance
of work with DB and don't make a lot of updates in the source code.
I have 4 solutions for that:
a) to create one main DB "C" with similar tables and views for that
tables in "A" and "B"
databases and use them through models;
b) to create one main DB, add new data for DB connection in database.yml
and
for "C" DB use transitive class like
class SharedModelBase < ActiveRecord::Base
self.abstract_class = true
establish_connection(ActiveRecord::Base.configurations["shared_db_connection_#{RAILS_ENV}"])
end
c) to create one main DB "C" and use db-charmer gem for changing db;
d) to use mysql replication with two main DB "A", "B";
Thanks.
--
Posted via http://www.ruby-forum.com/.
--
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.
No comments:
Post a Comment