No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

FusionInsight HD 6.5.0 Product Description 02

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Redis

Redis

Basic Concept

Introduction

Redis is an open-source, high-performance key-value distributed storage database. It supports a variety of data types, making up storage limitations of Memcached and meeting requirements for real-time and high-concurrency processing. In certain application scenarios, Redis is a good supplement to relational databases.

Redis is similar to Memcached. Besides, it supports data persistence and diverse data types. Redis supports union, intersection, and complement of mathematical sets on the server side and a wide range of sorting functions.

NOTE:

The network data transmission between the Redis client and server is not encrypted, which brings security risks. Therefore, do not use Redis to store sensitive data.

Structure

Redis consists of Redis Server and Redis WebService (Redis-WS), as shown in Figure 2-64.

Figure 2-64 Redis logical architecture

  • Redis Server: implements data read, write, and persistence, master/slave duplication, and cluster functions.
  • Redis-WS: implements operations, such as creating, adding, or reducing Redis clusters and querying or deleting cluster data, and stores cluster management information into DB.
Principle

Redis Persistence

Redis supports the following types of persistence:

  • RDB persistence

    Point-in-time snapshots are generated for data sets in specified intervals.

  • AOF persistence

    All write operation commands executed by a server are recorded. When the server starts, the recorded commands will be executed to restore data sets. All commands in an AOF are saved in Redis format, and new commands are added to the end of the file. Redis allows the AOF to be rewritten in the background, preventing the AOF size from exceeding the actual size required for storing data set status.

Redis supports AOF and RDB persistence at the same time. When Redis restarts, it preferentially uses the AOF to restore data sets because the AOF contains more complete data sets than RDB files. The data persistence function can also be disabled, allowing data exists only when the server is running.

Redis Operating Modes

The Redis instance can be deployed on one or multiple nodes, and a node can be deployed with one or multiple Redis instances. In the FusionInsight HD platform, the number of Redis instances on each node is calculated by the software based on the hardware node resources.

The latest Redis supports clusters. That is, multiple Redis instances constitute a Redis cluster to provide a distributed key-value database. Sharding is used to implement data sharing, replication, and migration in Redis clusters.

  • Single instance mode

    Figure 2-65 shows the logical deployment of the single-instance mode.

    Figure 2-65 Single instance mode

    The single instance mode is as follows:

    • There is one master node and multiple slave nodes, which can connect to slave nodes.
    • The master node distributes received commands to slave nodes for processing in real time.
    • If the master node is faulty, no slave node can work as the master node.
    • By default, slave nodes are read only. Slave nodes can write data when slave-read-only is set to no. If a slave node restarts, however, the slave node synchronizes data from the master node and the data previously written to the slave node will be lost.
    • The layered structure of slave nodes reduces the number of nodes directly connected to the master node. This structure improves service processing performance of the master node because the number of nodes that need to synchronize data from the master node is reduced.
  • Cluster mode

    Figure 2-66 shows the logical deployment of the cluster mode.

    Figure 2-66 Cluster mode

    The cluster mode is as follows:

    • Multiple Redis nodes constitute a Redis cluster, in which 16384 slots are evenly distributed to master nodes.
    • Each node in the cluster and the clients record the mapping between slots and nodes. The clients calculate the slot and send messages to the correct nodes for processing based on the mapping between slots and nodes.
    • By default, slave nodes cannot read or write data. To enable a slave node to read data only, run the readonly command online.
    • If a master node is faulty, the remaining master nodes in the cluster will select a slave node to serve as a new master node. The election can be performed only when more than half of the master nodes in the cluster are OK.
    • If cluster-require-full-coverage is set to yes, the cluster status is FAIL when a pair of master and slave nodes are faulty. If this occurs, the cluster cannot process commands. If cluster-require-full-coverage is no, the cluster status is OK as long as more than half of the master nodes are OK.
    • Redis clusters support capacity expansion (adding new nodes to a cluster) and reduction (removing Redis instances from a cluster) and slot migration.
    • At present, each Redis cluster in FusionInsight Farmer supports only one-to-one mapping between active and slave nodes.
Download
Updated: 2019-05-17

Document ID: EDOC1100074548

Views: 3267

Downloads: 36

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next