Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added README
- Loading branch information
1 parent
df20fa7
commit 70a4285
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
an ActiveRecord-JDBC plugin for working with MySQL master slave databases | ||
|
||
- install in vendor/plugins directory | ||
- use adapter "mysql" | ||
- use MySQL Connector/J JDBC replication driver: com.mysql.jdbc.ReplicationDriver | ||
- configure your master and slaves in the MySQL JDBC url in the normal way e.g. | ||
|
||
jdbc:mysql://masterhost:3306,slavehost:3307/databasename?autoReconnect=false&useUnicode=true&connectionCollation=utf8_general_ci&characterSetResults=utf8&autoReconnectForPools=true&jdbcCompliantTruncation=false&characterEncoding=utf8 | ||
|
||
- selects which are outside of a transaction will be sent to the slaves | ||
- any non-select queries or queries inside a transaction will be sent to the master | ||
- ActiveRecord::ConnectionAdapters::JdbcAdapter::with_master can be used to force use of the master for all queries |