Joke Collection Website - Mood Talk - What are the cluster schemes of redis?

What are the cluster schemes of redis?

A plurality of isomorphic twemproxy (with the same configuration) work at the same time,

Accept the client's request and forward it to the corresponding redis according to the hash algorithm.

Advantages:

-Simple development, almost transparent to applications

-It has a long history and a mature scheme.

Disadvantages:

-Proxies affect performance

-lvs and twemproxy will have node performance bottlenecks.

-redis expansion is troublesome.

The scheme has been abandoned within Twitter, and the newly used architecture is not open source.

Codis:

City zoo:

Store routing table and proxy node metadata.

Command to distribute Codis-Config.

Codis- configuration:

Integrated management tool with web interface.

Codis- agent:

Stateless proxy, compatible with Redis protocol

Transparent to business

Codis-Redis:

Based on version 2.8, secondary development.

Add slot support and migration commands

Advantages:

-Simple development, almost transparent to applications

-better performance than Twemproxy

-Graphical interface, easy to expand and easy to operate and maintain.

Disadvantages:

-Proxies still affect performance.

-Too many components, requiring a lot of machine resources.

Redis code has been modified, which makes it impossible to synchronize with the official, and the new function is slow to follow up.

-The development team is going to upgrade reborndb based on redis transformation.

Redis cluster:

P2P mode, without centralization

Divide the key into 16384 slots.

Each instance is responsible for a portion of the slots.

If the client request is not in the connected instance, the instance will be forwarded to the corresponding instance.

Synchronize node information through Gossip protocol

Advantages:

-Integrated components, easy to deploy and saving machine resources.

-Performance is better than proxy mode

-Automatic failover, data availability in slot migration

-Official original cluster scheme, which guarantees updating and support.

Disadvantages:

-The architecture is relatively new and there are few best practices.

-Limited support for multi-key operation (drivers can save the country by curve)

-To improve performance, clients need to cache routing table information.

-Node discovery and re-sharing operations are not automated enough.