当前位置:网站首页>Why should a redis cluster use a reverse proxy? Just read this one
Why should a redis cluster use a reverse proxy? Just read this one
2022-06-12 01:28:00 【Java technology stack】
author : Can't wait for Harmonica
link :www.cnblogs.com/Courage129/p/14351545.html
If there is no reverse proxy , a Redis You may need to connect to many clients :

Looking at whether it's very flustered ? Look, it doesn't matter , The main reason is that the connection consumes thread resources , Without an agent ,Redis A large part of resources should be used to establish a connection with the client ,redis It's highly available and scalable, whether it's built-in Redis Sentinel still Redis Cluster Both require additional support from the client , At present, there is basically no suitable client that can do these things , It's not appropriate for clients to do these things , It makes maintenance particularly difficult .
So in the client and redis An ideal solution is to add a layer of proxy between servers , Proxy shield back end Redis The implementation details are provided to the client redis service , It's a perfect solution Redis High availability and scalability issues of , At the same time, the introduction of agent also makes Redis Maintenance becomes easier .
So , With an agent :
How to use a proxy ?
It's simple , Connect the request to the scheduling agent , from Proxy Responsible for forwarding requests to the following Redis Service instance , Icon :

There's a new problem ,Proxy Hang up, but how to fix it ?
therefore Proxy And we need to do clustering , You can even add a layer of load balancing in front of it , Load balancing , Single machine also has single point of failure and other problems , One Director Definitely not , Maybe I hung up again , So the whole host and backup , The standby plane passes through KeepAlived To detect the main LVS health , If something goes wrong, go to the top .

Redis Proxy plug-in
Redis There are many proxy plug-ins , Here are a few
| predixy | High performance, all features redis agent , Support Redis Sentinel and Redis Cluster |
|---|---|
| twemproxy | Fast 、 Lightweight memcached and redis agent |
| codis | redis Cluster agent solution |
| redis-cerberus | Redis Cluster agent |
Agent detailed function comparison
| characteristic | predixy | twemproxy | codis | redis-cerberus |
|---|---|---|---|---|
| High availability | Redis Sentinel or Redis Cluster | Consistent Hashing | Redis Sentinel | Redis Cluster |
| Scalable | Key Hash distribution or Redis Cluster | Key Hash distribution | Key Hash distribution | Redis Cluster |
| development language | C++ | C | GO | C++ |
| Multithreading | yes | no | yes | yes |
| Business | Redis Sentinel Model sheet Redis Group support | I won't support it | I won't support it | I won't support it |
| BLPOP/BRPOP/BLPOPRPUSH | Support | I won't support it | I won't support it | Support |
| Pub/Sub | Support | I won't support it | I won't support it | Support |
| Script | Support load | I won't support it | I won't support it | I won't support it |
| Scan | Support | I won't support it | I won't support it | I won't support it |
| Select DB | Support | I won't support it | Support | Redis Cluster only one DB |
| Auth | Support to define multiple passwords , Give different read-write and management rights and Key Access space | I won't support it | Same as redis | I won't support it |
| Read from node | Support , Rich rules can be defined to read the specified slave node | I won't support it | Support , Simple rules | Support , Simple rules |
| Multi room support | Support , Rich rules can be defined to schedule traffic | I won't support it | Limited support | Limited support |
| Statistics | Enrich | Enrich | Enrich | Simple |
Simply speaking ,predixy Support both Redis Sentinel Also support Redis Cluster
- The back end is Redis Sentinel A group of monitors Redis, The function is completely equivalent to the original Redis
- The back end is Redis Sentinel Monitoring multiple groups Redis, Some functions are limited
- The back end is Redis Cluster, The function is totally equivalent to Redis Cluster
Recent hot article recommends :
1.1,000+ Avenue Java Arrangement of interview questions and answers (2022 The latest version )
2. Explode !Java Xie Cheng is coming ...
3.Spring Boot 2.x course , It's too complete !
4.20w Programmer red envelope cover , Get it quickly ...
5.《Java Development Manual ( Song Mountain version )》 The latest release , Download it quickly !
I think it's good , Don't forget to like it + Forward !
边栏推荐
- 只会基础的功能测试的我,被炒鱿鱼了····
- Article 4: Design of multifunctional intelligent trunk following control system | undergraduate graduation project - [data search skills + reference resource integration]
- The annual salary of testers in large factories ranges from 300000 to 8K a month. Roast complained that the salary was too low, but he was ridiculed by netizens?
- 手写MapReduce程序详细操作步骤
- Zhongchuang patents | China has 18000 necessary patents for 5g standards, respects intellectual property rights and jointly builds a strong intellectual property country
- Markov networks and conditional random fields
- MP3 to Wav to Midi
- 【项目实训】校验注解
- The role of MOV ah, 4CH int 21
- A summary of the interface automation test problems most easily encountered
猜你喜欢

Sharing of Manta network parallel chain solutions by Hufu Research Institute

Blog recommended | bookkeeper - Apache pulsar high availability / strong consistency / low latency storage implementation

Perceptron from 0 to 1

PCA from 0 to 1

我在某大厂做软件测试工程师的《一天完整工作流程》

Kmeans from 0 to 1

博文推荐|BookKeeper - Apache Pulsar 高可用 / 强一致 / 低延迟的存储实现

Low code platform design exploration, how to better empower developers

How to guarantee industrial control safety: system reinforcement

Weekly CTF 第一周:神奇的磁带
随机推荐
【项目实训】微信公众号模板消息推送
西南林业大学“西林链”通过工信部电子标准院功能测试 | FISCO BCOS案例
Matlab 基础04 - 冒号Colon operator “:”的使用和复杂应用详析
Simulated 100 questions and simulated examination for safety management personnel of metal and nonmetal mines (small open pit quarries) in 2022
You don't need to show your talent. The method is here. You earn 9844 in 31 days as an we media
Blog recommended | bookkeeper - Apache pulsar high availability / strong consistency / low latency storage implementation
Go language learning summary (7) -- Dachang go programming specification summary
Pytorch model loading and saving, and training based on the saved model
Comparison of OpenCV basic codes of ros2 foxy~galactic~humble
pca从0到1
Simulated 100 questions and simulated examination for safety management personnel of metal and nonmetal mines (small open pit quarries) in 2022
VM tools fail in VMware? Install VM tools using Ali image source
大厂测试员年薪30万到月薪8K,吐槽工资太低,反被网友群嘲?
Simulated 100 questions and simulated examination for safety management personnel of metal and nonmetal mines (small open pit quarries) in 2022
Unity顶点动画的阴影实现
Inventory: more than 20 typical safety incidents occurred in February, with a loss of nearly $400million
Forecast report on market demand and future prospect of cvtf industry of China's continuously variable transmission oil
Jmeter接口测试之常用断言
"It's safer to learn a skill!" The little brother of Hangzhou campus changes to software testing, and likes to mention 10k+ weekend!
Article 6: Design of multi-functional intelligent trunk following control system | undergraduate graduation design - [Key Technology - positioning technology related data (UWB WiFi Bluetooth)]