More about Tair (NOSQL)

Source: Internet
Author: User

First, preface

 Please refer to the wiki (http://code.taobao.org/p/tair/wiki/index/) or the previous blog post for more information about Tair, and don't repeat the description. Unlike other mainstream NoSQL databases, Tair supports multi-rack multi-machine room management, provides a complete set of cluster solutions and security mechanisms, this paper mainly introduces the Tair-related extensibility and reliability.

ii. Barrels (buckets)

Bucket is the most basic data storage unit of Tair, can be configured to specify the total number of buckets in the cluster (the number of buckets must be greater than the number of data servers), each DS need to allocate at least one bucket, the default configuration of 1023 barrels, if the deployment of 2 data Server then the two DS is 512,511 barrels, if 3 data server each DS is 341 barrels, when put data, Config server will calculate the key hash and a certain algorithm to assign data to a specific bucket, This allows the data to be distributed on the bucket, which is also the default distribution policy for the Tair bucket: Load balancing takes precedence, while Tair also provides a more advanced position security first policy that ensures that data is distributed across multiple duplication in the same bucket in different racks and rooms.

  

The following is an experimental environment of 4 data servers, the default 1023 buckets bucket Allocation table:

third, Control node (configserver)

   The Control node config server manages the data server node, maintains the data server's state information, uses a primary and standby (Master/slave) method to ensure reliability, and changes the configuration file under Main config server. Automatically synchronizes updates to the slave node, and when the primary node is unavailable, the slave node automatically takes over as the master node. The first time the client connects to config Server,cs will return a version of the routing table information to the client, after which the DS in the cluster will modify the routing table on CS version,client when connecting to CS again, compare version. If the inconsistency is the first update of the routing table, in theory, even if 2 config Server is down, the client can still access the cached routing table information directly to the data Server.

Iv. area, quota (Quota), LRU

  Area is similar to namespace, which is used to partition the data in the Tair cluster into logical partitions, by specifying multiple areas in the config server group.conf file, and setting a fixed quota Size per area. However, all area quota totals cannot exceed the total memory size allocated by all data servers. Each area is a separate snap-in, and the different area can contain key names with the same name. Data inserted through the Tair client to Tair exceeds the default threshold (8192 bytes) and is automatically compressed and then stored in DS, and when the accumulated put KV byte exceeds the quota size, Tair will enable the LRU policy (Least recently used). Automatic removal of expired kv. If the put specified area does not exist in config, Tair can automatically generate a temporary area and the temporary area will be automatically deleted when all data is removed.

1 #quota info (1024000=1m) 2 _areacapacity_list=0,2048000;3 _areacapacity_list=1,1024000;4 _areacapacity_list= 2, 1024000;

v. Disaster tolerance (COPYCOUNT) and load Balancing (Migrate)

  Tair can specify Copycount implementation of data for multiple backups, in theory, the more backup, the more data server number is more reliable, the backup data will be distributed according to a certain algorithm datas erver bucket, assuming copycount=3, Data Server has a number of 3, so the distribution is as follows. Increase or decrease data server, because the presence of Heartbeat,config server will immediately monitor changes to the DS, will recalculate a data bin distribution table, and then start the data migration, the access to the failure of data server to another data On the server, the migrate time and number of buckets, the number of KV, the migration process through the health command to monitor the remaining number of migration buckets per DS, when the end of the migration of all DS re-reach the data distribution balance. During the migration process, Config Server guarantees the correctness of the data distribution table, allowing the client to get the data.

For more atomic details on "What happens when data server is increased or decreased", please read "http://code.taobao.org/p/tair/wiki/intro/" first.

  

According to the schematic, there are 3 different data on each DS to allow the number of downtime 2, as long as 1 DS can work properly, then can guarantee the integrity of the data.

  

vi. Monitoring (monitor)

Tair provides monitoring tools to monitor the data distribution and query capabilities of all of the database servers, area locations in the current cluster.
Open Source SVN address: http://code.taobao.org/p/tair-monitor/src/trunk/tair_2_3_mon/
The project is based on a servlet, which needs to modify the Monitorargs file (tomcat/webapps/tair_2_3_mon/web-inf/classes/com/tair_2_3/statmonitor directory) after deployment. Specifies the address and port of the configserver.

configservera=10.129.221.70:5198 groupname=group_1 interval=10 is_rdb=false need_ Support_cplusplus=true Is_test_cluster=false

Vii. Thanks to the extensive verification work carried out by @Clear Shu shoes

More about Tair (NOSQL)

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.