Redis Cluster Edition

Last updated: 2020-02-26 16:06:09

PDF

Redis Cluster Edition is a new edition of Redis built by Tencent Cloud based on the Community Edition of Redis 4.0, which is compatible with the commands of Redis 4.0 and Redis 5.0. It uses a distributed architecture to enable elastic scaling and features high flexibility, availability, and performance of tens of millions of QPS. Specifically, it supports horizontal scaling of 3mur128 shards and vertical scaling of 1 Mustang 5 replica sets, where the scaling and migration are virtually imperceptible to the business, maximizing the system availability.

Cluster Specifications

  • Shard size (GB): 2, 4, 8, 12, 16, 20, 24, 28, 32
  • Number of shards: 3, 5, 8, 12, 16, 24, 32, 64, 96, 128
  • Number of replicas: 1, 2, 3, 4, 5

The maximum 2GB shard size is 8 shards.

Cluster Mode

  • In Redis cluster mode, data is automatically sharded. The system providers data load balancing and migration capabilities.
  • Redis cluster mode supports shards of 2mur32 GB specifications.
  • Commands in cluster mode are relatively compatible with non-cluster mode, mainly reflected in cross-Slot (slot) data Access. For more information, please see Command compatibility description .

Replica Description

  • When there is only one replica, Redis provides master/slave real-time hot backup for high data reliability and availability (is highly available across servers within the same availability zone. When the HA system detects a node failure, it requests for switching to a slave node, and add a new slave node to the system.
  • When the number of replicas is greater than 1, Redis provides master/slave real-time hot backup with the slave nodes being read-only.

Features

Flexibility
Redis Cluster Edition supports horizontal scaling of 3mur128 nodes and vertical scaling of 1 Mustang 5 replica sets, making it ideal for various scenarios through instance specification adjustment.
Availability
In Redis Cluster Edition, horizontal scaling (shard quantity) and vertical scaling (replica quantity) are virtually imperceptible to the business, maximizing the system availability.
Compatibility
Redis Cluster Edition supports use cases of native clusters of the Redis Community Edition and Codis and is compatible with clients such as Jedis.
OPS
Redis Cluster Edition maximizes system capability openness and has advanced features such as shard-level monitoring and management, data migration and load balancing, as well as monitoring of big and hot keys, which help facilitate total system management and OPS.

Use Cases

Master/slave high-availability scenarios
Redis Cluster Edition allows you to configure a replica set for a single node to achieve high master/slave availability. It boasts dual-server hot backup and automatic failover to ensure high reliability and availability of the Redis service.
Scenarios of read/write separation
When the number of replica nodes is greater than 1, automatic read-write separation can be enabled for the TencentDB for Redis instance to extend the read performance of a single node vertically. Up to 5 replica sets can be supported and read access weights across the master node and replica nodes can be configured.
High-performance scenarios for multiple shards
Redis Cluster Edition automatically enables auto-sharding and achieves horizontal scaling of system performance by assigning different keys to multiple nodes.

Command compatibility description

Redis cluster version of data is distributed storage, and the standard version of the command support the biggest difference is whether a single command supports multiple Key Access, cluster version of command support is divided into support, custom commands, not supported, detailed command compatibility list, see Command Compatibility .

Unsupported Commands
The system returns the following error:

 Keys
 (error) ERR unknown command 'select'

Commands with limited support

For compatibility with Jedis cluster, TencentDB for Redis modifies the IP list returned by the supported commands, and the IP address of each node in the returned information is the instance's VIP.

  • CLUSTER NODES
  • CLUSTER SLOTS
  • CONFIG GET

Supported cross-slot commands

The cluster version currently supports commands across Slot Access, including MGET, MSET, DEL, and other multi-KEY commands. Access does not support cross-SLOT commands.

Custom command

Through VIP encapsulation, Redis Cluster Edition provides a user experience in cluster mode comparable to the standalone edition, making it much easier for use in different scenarios. To increase the transparency to OPS, custom commands can be used. Access to each node in the cluster is supported by adding a parameter Node ID On the right of the original command parameter list, such as COMMAND arg1 arg2. Node ID. The node ID can be obtained through the cluster nodes command or in the console:

  10.1.1.1:2000> cluster nodes
  25b21f1836026bd49c52b2d10e09fbf8c6aa1fdc 10.0.0.15:6379@11896 slave 36034e645951464098f40d339386e9d51a9d7e77 0 1531471918205 1 connected
  da6041781b5d7fe21404811d430cdffea2bf84de 10.0.0.15:6379@11170 master - 0 1531471916000 2 connected 10923-16383
  36034e645951464098f40d339386e9d51a9d7e77 10.0.0.15:6379@11541 myself,master - 0 1531471915000 1 connected 0-5460
  53f552fd8e43112ae68b10dada69d3af77c33649 10.0.0.15:6379@11681 slave da6041781b5d7fe21404811d430cdffea2bf84de 0 1531471917204 3 connected
  18090a0e57cf359f9f8c8c516aa62a811c0f0f0a 10.0.0.15:6379@11428 slave ef3cf5e20e1a7cf5f9cc259ed488c82c4aa17171 0 1531471917000 2 connected
  ef3cf5e20e1a7cf5f9cc259ed488c82c4aa17171 10.0.0.15:6379@11324 master - 0 1531471916204 0 connected 5461-10922

  Native command:
  info server
  Custom command:
  info server ef3cf5e20e1a7cf5f9cc259ed488c82c4aa17171

  SCAN command examples:
  scan 0 238b45926a528c85f40ae89d6779c802eaa394a2
  scan 0 match a* 238b45926a528c85f40ae89d6779c802eaa394a2

  KEYS command example:
  keys a* 238b45926a528c85f40ae89d6779c802eaa394a2

List of custom commands:

  • Info
  • Memory
  • SLOWLOG
  • FLUSHDB
  • PING
  • KEYS (hashtag is supported and has matching priority)
  • SCAN (hashtag is supported and has matching priority)
  • monitor

Transactional support

Redis Cluster Edition supports transactional commands provided that the transactions are started by the WATCH command. The keys of a transaction should be stored in the same slot, and the keys of WATCH and transaction-related keys should be stored in the same slot too. HashTag is recommended for multiple key transactions in cluster mode.

Multiple DB support

Redis Cluster supports multiple DB, and supports 16 DB by default, so all commands related to DB operations are supported.