Rails 3 and mysql master-slave replications

2019-04-12 03:05发布

问题:

Want to set up mysql master-slave replications in rails app.

Are there plugins/db adapters available for Rails 3? Does the Masochism plugin work properly with rails 3?

回答1:

Try Octopus, which supports both rails3 and rails2.3: https://github.com/tchandy/octopus

Masochism, DbCharmer, data_fabric et al will probably never be updated for Rails3 since so many ActiveRecord internals have drastically changed.



回答2:

data_fabric also now claims support for Rails 3.0.7 https://github.com/mperham/data_fabric

and seamless_database_pool has been patched to support Rails 3 (but looks like it hasn't been updated in awhile): http://www.williambharding.com/blog/rails/rails-3-slave-database-options-there-are-two/