MySQL Database weekend learning mycat global table MySQL DBA

Source: Internet
Author: User
Tags dba

MySQL database business in some data similar to data dictionary, such as configuration file configuration, common business configuration or table with little change in data volume, these tables are often not particularly large, but most of the business scenario will be used, then this table is suitable for mycat global table, do not need to slice the data , just keep a copy of the data on all the shards, mycat in the join operation, the join aggregation of the business table and the global table takes precedence over the global table join within the same shard, avoids cross-Library joins, and when the data is inserted, Mycat will distribute the data to all the shards that correspond to the global table, and it will randomly fetch a node to read the data when the data is read.

The global table is configured as follows:

<table name= "T_area" primarykey= "id" type= "global" datanode= "DN1,DN2"/>

<?xml version= "1.0"?>

<! DOCTYPE mycat:schema SYSTEM "SCHEMA.DTD" >

<mycat:schema xmlns:mycat= "http://io.mycat/" >

<schema name= "TESTDB" checksqlschema= "true" sqlmaxlimit= "datanode=" "DN1" >

<table name= "Temp2" primarykey= "id" type= "global" datanode= "DN1,DN2"/>

</schema>

<schema name= "TESTDB2" checksqlschema= "true" sqlmaxlimit= "datanode=" "DN2" >

</schema>

<datanode name= "dn1" datahost= "Node1" database= "test"/>

<datanode name= "DN2" datahost= "Node1" database= "Test2"/>

<datahost name= "Node1" maxcon= "Ten" mincon= "5" balance= "2" writetype= "0"

Dbtype= "MySQL" dbdriver= "native" switchtype= "-1" >

<writehost host= "Master1" url= "192.168.237.128:3308" user= "root"

password= "MySQL" >

</writeHost>

<writehost host= "salve1" url= "192.168.237.130:3308" user= "root"

password= "MySQL" >

</writeHost>

</dataHost>

</mycat:schema>

Most of the databases used by internet companies are MySQL, want to stand out from the many it workers, need to have advanced technology, learning to add value is essential. The way of learning is your insistence. Old boy Education MySQL DBA course, after several update courses, to eliminate the theory, the whole enterprise real case combined with theoretical teaching, want to deep learning MySQL DBA knowledge, can pay attention to the old boy education.


MySQL Database weekend learning mycat global table MySQL DBA

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.