A simple summary of redis clusters

Source: Internet
Author: User

Redis What is Redis?

Redis is the abbreviation for remote dictionary server and is a key-value type data storage System

Redis features

Rich data types and operations:string, list, hash, set, sorted set

Data persistence

Master-slave replication

Key expires

Transaction

Key Expires

Lazy Delete: Determine whether to expire on each read and write operation, delete after expiration

Timed Delete:redis servercron Program Delete expiration key

Regular cleanup: Check the expires dictionary for cleanup

Master-slave key expiration: The primary server is deleted, will sync to from, expires from the access will not be deleted, only return key is empty

The master/slave server will filter the expiration key when saving the rdb file

The expiration key is not filtered when the Rdb file is loaded, and the main

Persistence of

RDB Mode: Writes the memory data to the disk as a snapshot.

The parent process continues to process the client request, which is responsible for writing the memory contents to the temporary file, replacing the original snapshot file with a temporary file after the child process writes the snapshot to the temporary file, and then the child process exits

Advantages and Disadvantages: High performance, small data consumption disk; Once crashed, the data loss rate teaches large, large amount of data rewriting when I/O overhead is large

Aof : Each write command will persist all write commands, and when restarted, restore the data by re-executing the commands. When the data is restored, only functions such as database-independent subscriptions receive requests normally, and others fail.

Advantages and Disadvantages: The performance is relatively low, the data occupies a large disk, the data loss is less, performance is relatively stable.

aof rewrite: As the running time goes by,   Span style= "Font-family:times New Roman" >AOF  files are getting bigger and larger, saving space by rewriting

main process fork aof rewrite the cache, the main process handles the command request, and the main process appends the command to the existing aof aof rewrite cache, child process complete aof file rewrite, notifies the main process, the main process will aof Rewrite cache contents are all written to the new aof aof file is renamed, overwriting the old aof file

master-slave replication

Master-slave replication is the synchronization of data from one Redis database to another redis Database

a master can have multiple slave slave slave master can have multiple slave

In addition to multiple slave connected to the same master ,slave can also connect to other slave Forming a graphic structure

Master-slave replication does not block primary. Conversely , slave will block requests that cannot process the client when the data is first synchronized .

Process: Left slave, right master

   

Cluster Architecture

There are many ways to do Redis clusters, so here's a quick introduction to one of them.

Master-Slave structure, the primary node is used to process all requests from the node backup. The script timed the rdb backup. The script monitors the node state and the master-slave drift switch. Zookeeper Save configuration, client and Zookeeper cluster Communication maintain cluster state information. Double extension.


A simple summary of redis clusters

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.