Data segmentation with Amoeba MySQL read-write separation

Source: Internet
Author: User
Tags cdata

(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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.