Redis hybrid storage instance is a cloud database product that is compatible with Redis protocol and features independently developed by Alicloud. The hybrid storage instance breaks through the limitation that all Redis data must be stored in memory, uses disks to store full data, and caches hot data into memory, achieving a perfect balance between access performance and storage cost.

Structure and Features



The command is compatible with

Hybrid storage is compatible with most Redis commands. Compared with native Redis, the following commands are not supported or restricted. The main reason is that performance is not supported. If it is used in services, please submit work orders.

Keys (key) List (linked List) Scripting (Lua Script)
RENAME LINSERT SCRIPT does not support LOAD and DEBUG subcommands
RENAMENX LREM
MOVE

SWAPDB

SORT does not support the STORE option

Selection guide – Scenarios



Selection guide – Specifications

When selecting mixed storage instances, you need to select appropriate memory configuration + Disk configuration. Disks determine the total amount of data that can be stored, and memory determines the total amount of hot data that can be stored. During instance production, you can configure PROPER CPU resources based on storage specifications. Currently, you cannot customize the number of CPU cores.

For example, [64GB memory + 256GB disk] instance means that the instance can store up to 256GB of data (based on the total size of physical files of KV storage engine), of which 64GB of data can be cached in memory.

Case 1: User A uses Redis Cluster to store 100GB of data, the total access QPS is less than 2W, and 80% of the data is rarely accessed. User A can use the [32GB memory + 128GB disk] hybrid storage instance, saving nearly 70GB of memory storage and reducing the storage cost by 50%+. Case 2: User B builds a Pika/SSDB instance in IDC to solve the problem of high storage cost of Redis. About 400GB of data is stored, of which about 10% is actively accessed. Therefore, the cluster operation and maintenance burden is heavy and user B wants to migrate to the cloud database. User B can use the [64GB memory + 512GB disk] mixed storage instance to ensure that o&m is not required and service quality is not degraded.

Note: Because Redis data is stored in KV storage engine, each key will have additional metadata information, and the storage space will be enlarged to a certain extent. It is recommended to leave an appropriate allowance for disk space selection, which is estimated as 1.2-1.5 times of the actual storage demand.

Performance indicators

The performance of Redis hybrid storage is highly related to memory disk ratio and service access. The performance of a simple SET/GET can vary from a few thousand to tens of thousands, depending on the specification configuration and service access mode. In the best case, all accesses are memory hit, and the performance is basically the same as Redis memory edition; Worst-case scenario all access needs to be read from disk.

Test scenario: 2000w keys, value size: 1KB, and 25% hot keys can be stored in memory. Test data for get requests is as follows

The test set Memory edition (100% data in memory) Mixed storage edition (25% data in memory)
Random access (12.3 m) 1.5
A Gaussian distribution has an 80% probability of accessing 20% of keys 12.0 5.4
The Gaussian distribution has a 99% probability of accessing 1% of keys 13.5 11.4

Application scenarios

Live video

Live video services often have a large amount of hot data, and most of the requests come from popular live broadcast rooms. With the Redis hybrid storage type example, the hot broadcast room data is kept in memory, and the inactive broadcast room data is automatically stored on disk, which can achieve the best use of limited memory.

Electrical business class

E-commerce applications have a large amount of commodity data, and the newly listed commodities are frequently visited, while the old commodities are not popular. Redis hybrid storage instances can easily break through the memory capacity limit and store a large amount of commodity data to disks. In normal service requests, active commodity data will be gradually cached in the memory to meet service requirements at the lowest cost.

Online education

In the scenario of online education, there are a large number of data such as courses, question banks and communication information between teachers and students. Usually, only popular courses and the latest question banks are frequently accessed. Using Redis hybrid storage type, a large amount of course information is stored on disk, and active course and question bank information will be changed into memory and resident in memory, ensuring the performance of high-frequency data access and achieving a balance between performance and storage cost.

Other scenarios

Redis hybrid storage can be used to reduce storage costs in scenarios with obvious hot and cold data access and low performance requirements.

Redis version of cloud database

A stable and reliable, excellent performance, flexible and scalable database service. It is based on the Flying Distributed system and high performance storage of all SSDS, and supports two sets of high availability architecture: primary/secondary edition and cluster edition.


Author: Zhang Youdong

The original link

This article is the original content of the cloud habitat community, shall not be reproduced without permission.