当前位置:网站首页>What are the pitfalls of redis's current network: using a cache and paying for disk failures?

What are the pitfalls of redis's current network: using a cache and paying for disk failures?

2022-06-10 16:27:00 InfoQ

This article is shared from Huawei cloud community 《
Redis Now net those pits : Use a cache , And pay for disk failures ?
》, author : GaussDB  database  .

In recent days, , Some online e-commerce users have experienced the phenomenon of inventory business query timeout , Go deep into the root cause , Is what it uses Redis The bottom layer of cloud services SSD Card hardware failure , Affected Redis The stability of , Eventually, it will lead to business timeout .

null
At this time, a series of question marks flashed in my mind :

null
that , cache Redis Why on earth can't you get around the barrier of disk ?

From a technical point of view , Use the cache Redis And a disk , On the one hand, it is because of open source Redis Rely on persistence mechanisms , Ensure that some data can be retrieved after downtime , On the other hand, this is also essential for master-slave synchronization . Open source Redis Two persistence schemes are provided ——RDB and AOF, among :
  • RDB By taking a snapshot of memory , Back up data to disk . Open source Redis The full synchronization between master and slave depends on RDB file .
  • AOF It records data changes by adding logs . Open source Redis Downtime restart available AOF File loading “ Relatively complete ” The data of .

Think of it here. , The author suddenly realized : Current network problems of e-commerce users , It turns out that RDB and AOF All mechanisms need to be tested IO, Disk failure directly affects Redis The persistence of , And then blocked Redis The normal service of !

null
besides , cache Redis There are also various defects in the persistence of :
  • AOF The write frequency can only be configured in seconds , stay Redis One hundred thousand QPS Under the circumstances , In case of downtime, there will still be a lot of data that cannot be retrieved ;
  • More data , Restart loading AOF The slower ;
  • RDB Generation and AOF Rewriting will trigger fork problem , Cause performance jitter .

thus it can be seen , cache Redis The persistence of is neither stable 、 It's not reliable , Even because of disk performance 、fork The problem leads to the instability of the upper business . However, out of data “ relative ” Security 、 Reliable demand , cache Redis I really can't cross the barrier of disk .

null
build by oneself Redis My friends will inevitably encounter this dilemma : At first, it was equipped with an ordinary disk , Later, I encountered various problems of persistent blocking Services , Have to upgrade the disk . Review the previous Redis Instance failure , It's not hard to see : cache Redis Persistence and disk problems never seem to be reassuring .

that , Is there a plan for once and for all , You can talk to Redis Say goodbye to the problems caused by persistence ?

null
GaussDB(for Redis)
As an enterprise level enterprise promoted by Huawei cloud Redis, It has stable and reliable natural advantages , It is based on the separation of deposit and settlement 、 Multi copy strong consistency architecture , Abandoned RDB/AOF Mechanism , Completely solved open source Redis Persistence performance is unstable 、 Data inconsistency 、 Problems such as unreliable disk , Help enterprise users really reduce costs and increase efficiency .

that GaussDB(for Redis) What are the “ Black science and technology ” Well ?
  • use SPDK technology , Through user status 、 asynchronous 、 unlocked 、 Drive the disk by polling , Compared to open source Redis Kernel driven , The speed is greatly improved .
  • High performance distributed shared storage pool adopts RDMA and DPDK technology , The system throughput is greatly improved , Speed up data processing , Reduce communication delay .
  • use SCM technology , Will approach the performance and speed of memory , Similar to SSD Combined capacity and cost , Build a strong base .

null
It is so ,GaussDB(for Redis) While ensuring the drop of data command level , Can easily support millions QPS High concurrent access , And sub millisecond delay . Its bottom layer uses high-performance distributed shared storage pool , The service will not be blocked due to disk failure ; meanwhile , The cost of hardware is much lower than that of cache Redis, And the larger the amount of data, the higher the cost performance .

since Redis Persistence is indispensable 、 Can't do without disk , Then why not choose one that combines the advantages of performance and persistence Redis Database ? Just like the e-commerce scenario mentioned above ,GaussDB(for Redis) With its unique strong consistency 、 stability 、ACID Business , Not only can it be easily done “ stock ” Business , Its strong persistence ability can escort the enterprise's core data storage .

  • The author of this article
    : Huawei cloud database GaussDB(for Redis) The team
  • More product information , Welcome to Hua Weiyun GaussDB(for Redis) Official website

Click to follow , The first time to learn about Huawei's new cloud technology ~​
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203021024342994.html