(3) using amoeba to achieve data segmentation, higher level of read and write separation
continue from above the use of amoeba to achieve read and write separation configured for re-configuration:
(client,proxy,two master,two slave Server at least 6 virtual machines)
Split horizontally: Store key fields on a specific algorithm to different servers
Vertical Segmentation: Save data to different servers by business difference
650) this.width=650; "src=" http://note.youdao.com/yws/res/20743/48114EFCAA8D4F898943C14C5413ABD2 "alt=" Qq20150724154840.png "/>
split Horizontally
# cd/usr/local/amoeba/conf/
# Vim Rule.xml
stu table under #sxjy database # See master1,2 is horizontal split
<tablerule name= "Stu" schema= "Sxjy " defaultpools= "Master1,master2" >
<rule name= "Rule1" >
<parameters>id</parameters>
<expression><! [cdata[id% 2 = = 0]]></expression>
<defaultPools>master1</defaultPools>
<readPools>slave1</readPools>
<writePools>master1</writePools>
</rule>
<rule name= "Rule2" >
<parameters>id</parameters>
<expression><! [cdata[id% 2 = = 1]]></expression>
<defaultPools>master2</defaultPools>
<writePools>master2</writePools>
<readPools>slave2</readPools>
</rule>
</tableRule>
Vertical Split
<tablerule name= "user_info" schema= "blog" defaultpools= " master1"/>
<tablerule name= "User_info" schema= "webchat" defaultpools= "Master2"/>
This article is from the "Zhanglulu" blog, make sure to keep this source http://zhanglulu913.blog.51cto.com/10592685/1688951
Data segmentation with Amoeba MySQL read-write separation