mybatis / spring

Spring integration for MyBatis 3
Apache License 2.0
2.82k stars 2.6k forks source link

add read write seprate for mybatis-spring #99

Open charlesluo2014 opened 8 years ago

charlesluo2014 commented 8 years ago

hi,all! when use database for business development,the perfomance of the database is a very frequently question。one simple method is to use the read-write seprate to solve the problem。another way is to use sharding to support。I implement the sharding support by delegate the jdbc,the git repository:https://github.com/58code/Oceanus so can we integrate the solution in the mybatis or mybatis-spring for example(read write support):

   <mybatis:sharding>
        <datanode id="trxSharding" master-ref="marsterDatasource">
           <namenode id="slave1" ref="slaveDatasource1" power="90" />
           <namenode id="slave2" ref="slaveDatasource2" power="190" />
        </datanode>
   </mybatis:sharding>
emacarron commented 8 years ago

I will have a look. Thanks for the offer!

CodeingBoy commented 5 years ago

Since read-write separation is done in JDBC level, MyBatis or MyBatis-Spring can/should remain untouched. No need to integrate built-in support directly. Also, the repository you provided seems like discontinued.