当前位置:网站首页>Redis usage scenario sharing (project practice)
Redis usage scenario sharing (project practice)
2022-06-22 21:34:00 【Chen Xi should work hard】
【 Chen Xi has to work hard 】:hello Hello, I'm Chen Xi , I'm glad you came to read , Nickname is the hope that you can constantly improve , Moving forward to good programmers !
The blog comes from the project and the summary of the problems encountered in programming , Occasionally there are books to share , I'll keep updating Java front end 、 backstage 、 database 、 Project cases and other related knowledge points summary , Thank you for your reading and attention , I hope my blog can help more people , Share and gain new knowledge , Make progress together !
We quarryers , The heart of a cathedral , May we go in our own love …
One 、 Application scenarios
Redis The use of is to ease the high and send MySQL The pressure !
quote Redis after , The first query MySQL, Store data synchronization in Redis in , Subsequent queries can directly query the cache 
I share my B Application scenarios in end products !
For example, a merchant inquires about the sales volume of its own store , sales volumes , Customer unit price , Gross profit margin and other data !
- Base date data : Like today 2022-06-10 So the benchmark time is 2022-06-09( The day before )
- Underlying data logic : The underlying data is not simply queried , For example, sales volume involves function calculation , Gross profit margin is calculated in the business code

After querying the corresponding data, store it in Redis in , Follow up directly from Redis Take it
About Redis and MySQL Analysis of data consistency in this scenario
Real business scenarios : Before today's Day , For example, before eight o'clock , The sales data of the previous day will be synchronized to our database table , And it won't change ! At the same time, the deadline for sales data that can be queried today is the previous day ( Financial day ). So no matter how many times MySQL and Redis The data are the same !( because MySQL Business data will not change ); Introduce... Here Redis The interface speed is greatly optimized !
Two 、 Application effect
Original logic : service layer Encapsulation method 1,2,3 return result Cache database not used
Present logic : service layer Check cache , There are direct returns in the cache ( Only the first time you need to query MySQL) Use the cache database 
Graphic, : introduce Redis After caching, it is obvious that the execution logic of the corresponding interface is shortened , And greatly shorten 
Real business sharing
What we're doing right now B End business , A one-time query may involve more than a dozen fields , Add the year-on-year and month on month calculations , The access request of an interface may be about 2-3S; If the cache database is used, it can be directly optimized to 0.1-0.2S;
B End products +C End products
What we're doing right now B The end product mainly means that the merchant can see the sales data , Focus on querying specific data , Businesses are more concerned about whether the data queried is correct , Therefore, there are many query fields in business , Interface access is slow , At present, the average number of first-time queries is 2-3S, But such a scenario is understandable for businesses !
- B End products , Also called To B(To Business) product , That is, enterprise level products for enterprises or specific user groups ;
- C End products , Also called To C(To Customer) product , That is, products for ordinary consumers .
- B Focus on function ,C Focus on experience .
3、 ... and 、 Related expansion
Share what you have sorted out before Redis Related knowledge , Welcome to punch in 、 communicate 、 communication !
- Read Redis Master slave architecture 、 Sentinel mode 、 colony
- Read Redis Persistence mechanism
- Redis Cache breakdown 、 Cache penetration 、 Cache avalanche principle and solution
- Redis Data type String Application scenarios of
- Redis Detailed explanation of basic interview knowledge
Thank you very much for reading here , If this article helps you , I hope I can leave your praise Focus on ️ Share Leaving a message. thanks!!!
May we go in our own love !
边栏推荐
- 基于AI驱动大分子药物发现,「华深智药」获近5亿元A轮融资
- RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasSgemmStridedBatched( ha
- [records of different objects required by QIPA]
- Baijia forum Huangdi Neijing (Part I)
- Jerry's problem of opening the near end of four channel call [chapter]
- 杰理之开启四声道通话近端卡顿问题【篇】
- [redis]Redis6的事务操作
- [redis]集群与常见错误
- 【206. 反转链表】
- win10安装.net3.5.docx
猜你喜欢

优化求解器 | Gurobi的MVar类:矩阵建模利器、求解对偶问题的备选方案 (附详细案例+代码)
![kali2021安装RTL8188GU无线网卡[TL-WN726N]驱动](/img/29/8dd188cc4e909562862b5f2c57c898.png)
kali2021安装RTL8188GU无线网卡[TL-WN726N]驱动

One line of code binds swiftui view animation for a specific state

杰理之硬件上 DACL 输出,DAC 输出左右声道的声音【篇】
![Jerry's near end tone change problem of opening four channel call [chapter]](/img/03/f08cd660c1c602aa08218c4c791ec3.png)
Jerry's near end tone change problem of opening four channel call [chapter]

【138. 复制带随机指针的链表】
![[513. find the value in the lower left corner of the tree]](/img/6d/b2ec8e3072a65c20c586941e6b2a85.png)
[513. find the value in the lower left corner of the tree]
![[the penultimate node in the linked list]](/img/b2/be3b0611981dd0248b3526e8958386.png)
[the penultimate node in the linked list]
![[redis]redis persistence](/img/83/9af9272bd485028062067ee2d7a158.png)
[redis]redis persistence

The second harmonyos application development training
随机推荐
ByteDance proposes a lightweight and efficient new network mocovit, which has better performance than GhostNet and mobilenetv3 in CV tasks such as classification and detection
ICML2022 | 利用虚拟节点促进图结构学习
基于C语言开发工资管理系统 课程论文+源码及可执行exe文件
【ICML2022】利用虚拟节点促进图结构学习
[redis] profile
第031讲:永久存储:腌制一缸美味的泡菜 | 课后测试题及答案
杰理之列免晶振一拖八烧录升级【篇】
[142. circular linked list II]
Arcgis中las点云数据抽稀
[redis]Redis6的事务操作
5分钟快速上线Web应用和API(Vercel)
Jericho uses DP and DM for IO key detection [chapter]
CVPR2022 | 海德堡大学《深度视觉相似性与度量学习》教程
84- I am on Internet & lt; 52 SQL statement performance optimization strategies & gt; Some views of
localStorage、sessionStorage 和 cookie 的区别大总结
杰理之在music模式下提示音使用打断模式无法播放的问题【篇】
Fegin的解析
Learning websites that programmers must see
[redis]集群与常见错误
【CM11 链表分割】