Recently, I wrote an email to persuade OP to disagree with the redis version in the production environment. This article mentions why redis2.4 is used instead of 2.2, and how to solve others' concern. First, we will elaborate on extraordinary feature, then explain the concern to others, and propose a solution. In the end, OP is still compromise, it's a victory.
Recently, I wrote an email to persuade OP to disagree with the redis version in the production environment. This article mentions why redis2.4 is used instead of 2.2, and how to solve others' concern. First, we will elaborate on extraordinary feature, then explain the concern to others, and propose a solution. In the end, OP is still compromise, it's a victory.
Recently, I wrote an email to persuade OP to disagree with the redis version in the production environment. This article mentions why redis2.4 is used instead of 2.2, and how to solve others' concern. First, we will elaborate on extraordinary feature, then explain the concern to others, and propose a solution. In the end, OP is still compromise, it's a victory. Record it here.
?
Dear Operation System,
?
First, I would like to thank OP for their support for using Redis for RD. For Redis versions 2.4.14 or 2.2, there are differences during detailed review. In terms of multiple trade-offs, RD insisted on using version 2.4, which brought about one benefit.
?
1. Fast Import
The pipeline mode can be used for v2.4 import. In the command line, raw commands can be directly transmitted to the redis-cli client through pipelines for batch import.
?
The command is as follows:
?
Echo 'date'> importlog &&? Cat cmd. raw | redis-cli-h 10.81.31.95-p 16379-pipe> importlog & echo 'date'> importlog
?
Time consumed: million data, 4 min import. The throughput is 15 w/s.
?
?
V2.2 import uses plain command to pass commands to redis one by one, so it consumes a lot of time to initiate a remote call.
?
The command is as follows:
?
Echo 'date'> importlog2 & cat cmd. plain | redis-cli-h 10.81.31.95-p 16379> importlog2 & echo 'date'> importlog2
?
Time consumed: million data records, which can be imported in Min. Throughput: 1 k/s.
?
?
Conclusion: The pipeline feature allows you to quickly import big data and complete tasks in the shortest and most economical way. It also simplifies the online steps and facilitates future maintenance and data migration.
?
?
?
2. Other reasons
Speed up the persistence of RDB files.
The memory allocation mode of jemalloc is less memory fragments, thus saving more memory.
...
For details, see the link.
?
?
?
Other concern
?
Q: Is OP worried that XX projects will expand YY data?
?
A: This project is currently in the kickoff phase. If the business data volume increases sharply in YY in the future, you can enable the migration solution to migrate the redis cluster to A machine with A larger memory (budget will be made in advance ), because of the pipeline feature of version 2.4 and rdb persistence, the migration can be smoothly completed without complicated migration process.
?
?
?
Q: Why not use memcache?
?
A:
?
-This application scenario is to meet the 100% hit rate, so put all the data into the memory, in fact, redis is used as a K-V DB, not simply as a cache.
?
-Enable the persistence feature. When the down machine recovers, dump is quickly loaded and pushed.
?
-The project team plans to change the APP + DB architecture to APP + CACHE + DB. Therefore, you need to sync the modification operations on the DB to NoSQL for the business module to quickly obtain data, solve the Problem of Beidou "slowness.
?
-Redis can be used as a centralized queue or data storage medium that is not important to services, which is very helpful for Distributed calls. All scenarios in which the system can be replaced by the producer consumption model can be transformed to use redis to remove single point of failure. Distributed locks, pub/sub, and other functions can be used in the future.
?
?
In addition, because 2.4 is a branch of Version 2.2, It is backward compatible.
?
Original article address: Why should I use a persuasion email from a later version of redis? Thank you for sharing it with the original author.