当前位置:网站首页>Who says redis can't save big keys
Who says redis can't save big keys
2022-06-09 13:42:00 【Huawei cloud developer Alliance】
Abstract : Recommended GaussDB(for Redis) Get it done " Big key" Storage , Fundamentally solve the community version Redis Use risk .
This article is shared from Huawei cloud community 《 Hua Wei Yun GaussDB(for Redis) Uncover secrets 18 period : Who says Redis Cannot save large key》, author : gaussian Redis The official blog .
One 、 Community Edition Redis The big key Pain points
GaussDB(for Redis) Expert Xiaoqiang has been a little busy recently , Because many account managers come to him to consult the community version Redis The big key problem , And all of them are eager for knowledge :

Xiaoqiang slaps his thigh : You really asked the right person !
According to the current network experience , The production environment is large key As a result of Redis Accidents are common , The typical one is capacity expansion failure 、 Request blocking 、OOM Downtime, etc . Inadequate early business planning 、 Message queue consumption is not timely 、 Failure to clean up invalid data in time and other reasons may lead to big key hidden danger .
Community Edition Redis Big key Hidden dangers are common in the following three scenarios :
- Memory consumption is uneven , Big key There are OOM risk
- Some data needs to be moved during capacity expansion , Big key It takes a long time , It will lead to access blocking and even data loss
- Delete or expire large key when , Business access is blocked for a long time , Even lead to master-slave synchronization interruption
Community Edition Redis The architecture is not suitable for reliable storage key, The industry can only recommend prevention 、 Disassemble or timely clean up large key. From a customer perspective , In fact, some scenes need to be big key Of , Such as enterprise ERP System , Massive currency exchange rate storage, etc . At this time, even if it is properly split , Also can not avoid larger HASH key There is .
Two 、 Hua Wei Yun GaussDB(for Redis) The big Key Solution
Xiaoqiang always believes that , A good product should try to leave the complexity to itself , Leave simplicity to users . therefore , Xiaoqiang asks everyone about big key The problem account managers are Amway better Solution —— Use Huawei cloud enterprise level KV database GaussDB(for Redis).
Big key scenario ,GaussDB(for Redis) It's better than the community version Redis Where is the excellence ? The following from 3 In depth analysis from three angles :
1. gaussian Redis Support big key Storage , Don't worry about fragmentation OOM
- Community Edition Redis Big storage key This will lead to uneven consumption of fragmented memory , As the overall data volume of the cluster rises , Big key At any time, there are OOM risk .

- gaussian Redis Support big key Reliable storage , And will not lead to fragmentation OOM. It should be noted that , Although Gauss Redis Suitable for reliable storage of large key, But from the perspective of network links , The business should avoid large key Perform such as hgetall And so on .

2. gaussian Redis At large key The scene also supports second level lossless capacity expansion
- Community Edition Redis During the expansion , Due to data relocation , At this time, the painting style is like this :

chart : Community Edition Redis At large key Scene expansion , High risk
It can be summarized as : Have big key, Open source Redis Please expand the capacity carefully !
- gaussian Redis Support second level capacity expansion , And support to upgrade the specification 、 Add nodes 、 Add storage capacity 3 Flexible capacity expansion by means of , Excellent operation and maintenance experience .

chart : gaussian Redis At large key The scenario can be safely expanded
As can be seen from the above figure , gaussian Redis By calculation 、 Architecture separation storage , There is no need to move any data during capacity expansion , So speed 、 The stability is far better than the community version Redis. Have big key, gaussian Redis You can safely expand the capacity !
3. gaussian Redis Delete / Overdue large key when , Business 0 Blocking
- Community Edition Redis Big key The deletion of / Expiration will lead to severe access blocking . Measured delete / One big overdue hash key( contain 1000w Elements ), Community Edition Redis Access is blocked for a whole 14 second .

chart : Community Edition Redis At large key Delete the scenario blocking service access
Although the Community Edition Redis Provides “ asynchronous ” Of unlink The command can alleviate the big key Blocking problem , but unlink Not strictly asynchronous , For example, for zset type (skiplist code ) And all string key Can only block deletion , The risk is out of control .
- gaussian Redis It has fundamentally solved the problem of "big..." key Delete / Hidden danger of overdue operation . In Gauss Redis in , Yes whatever Data is deleted / Be overdue , Both are executed successfully and immediately 0 Blocking . This is because the bottom layer adopts the real “ Mark deletion ”, So it doesn't affect business access at all . Measured delete / One big overdue hash key( contain 1000w Elements ), gaussian Redis only millisecond .

3、 ... and 、 summary
According to the above comparative evaluation , It can be seen that compared with the community version Redis The actual performance of , gaussian Redis More suitable for large key Reliable storage scenarios for . In addition to being able to solve business problems key Outside the pain point , gaussian Redis The stability of 、 reliability 、 Security and other aspects have also been comprehensively improved .

Huawei partners and developers conference 2022 The fire is coming , Heavy content can't be missed !
【 Wonderful activities 】
March forward courageously · Be an all-around Developer →12 Technology live broadcast ,8 High energy output of the great technical treasure , And the code room 、 Many rounds of mysterious tasks such as knowledge competition are waiting for you to challenge . Break through immediately , Open the ultimate prize ! Click to embark on the promotion of all-round developers !
【 Technical topics 】
The future has to ,2022 Technical exploration → Huawei's cutting-edge technologies in various fields 、 Heavy open source project 、 Innovative application practice , Standing at the entrance of the intelligent world , Explore how the future shines into reality , Full of dry goods, click to learn
Click to follow , The first time to learn about Huawei's new cloud technology ~
边栏推荐
- [leetcode weekly race record] record of the 296th weekly race
- 机器学习-学习笔记(二) --> 模型评估与选择
- 2022.5.29-----leetcode.468
- Zhengzhou Evan technology security headlines
- Database day-5
- 面试题 08.04. 幂集
- Explain asynchronous tasks in detail: the task of function calculation triggers de duplication
- MySQL Installer 方式安装MySQL
- BI报表系统有什么特点
- 网络攻击盯上民生领域,应对DDoS和APT攻击,如何有效防御?
猜你喜欢

Yunna | how to manage fixed assets better? How to manage the company's fixed assets?

论文阅读《LEAStereo:Hierarchical Neural Architecture Search for Deep Stereo Matching》

Digital transformation: how to gain organizational recognition?

网络七层结构是干啥的?看这篇文章就够了

Navicat instructions

Yunna RFID asset management, advantages of RFID asset management system

【C语言练习——调整数组内奇数偶数的顺序】

周博磊《模型可解释性年度进展概述》20200805

精益产品开发体系最佳实践及原则

What is the seven layer network structure for? Just read this article
随机推荐
浅析网络可视化分析技术
【C语言练习——合并两个有序序列】
IDEA将现在新增加的修改合并cherry pick到之前的版本
Yunna | which department manages the fixed assets and who manages them
云呐|行政单位固定资产管理制度,单位固定资产管理办法
2022.5.30-----leetcode.1022
Event storm method of DDD modeling methodology
Execution engine of JVM family
云呐|固定资产归哪个部门管理,归谁管理
Repo 流程
C language stack -- chain stack
Using kubekey to build kubernetes/kubesphere environment
[C language practice - exchange the values of two variables]
Explanation of the top command
【C语言练习——打印正方形及其变形】
Navicat instructions
云呐|服务器监控的重要性,监控管理服务器有什么作用
C language -- linear list -- double linked list
com. alibaba. fastjson. Jsonexception: syntax error, POS 1, line 1, column 2 test
What is the seven layer network structure for? Just read this article