当前位置:网站首页>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 !
边栏推荐
- jmeter 性能测试用 csv,这个坑有些扯蛋
- You don't need to show your talent. The method is here. You earn 9844 in 31 days as an we media
- Analysis report on operation trends and development strategies of global and Chinese plastic adhesive industry 2022-2028
- “还是学一门技术更保险!”杭州校区小哥哥转行软件测试,喜提10K+双休!
- Before applying data warehouse ODBC, you need to understand these problems first
- UoE UG2 Inf Course Research
- Matlab 基础04 - 冒号Colon operator “:”的使用和复杂应用详析
- MP3 to Wav to Midi
- Kill, pkill, killall, next, what I brought to you in the last issue is how to end the process number and rush!
- Weekly CTF week 1: Amazing tapes
猜你喜欢

What is the digital twin of Yixin Huachen and what is its application value?

jvm: 线程上下文类加载器(TheadContextClassLoader)

PCA from 0 to 1

Prism框架初识-模块化介绍

Common assertions for JMeter interface testing

Intel trimbert: tailor Bert for trade-offs

【项目实训】微信公众号获取用户openid

网狐游戏服务器-房间配置向导-组件属性与基本配置赋值
![[project training] verification notes](/img/bd/fa6111d967da6258bc53d6755cc3a2.png)
[project training] verification notes

New knowledge: monkey improved app crawler
随机推荐
只会基础的功能测试的我,被炒鱿鱼了····
flowable 工作流
Chapter V - Fund professional ethics
A summary of the interface automation test problems most easily encountered
The road of global evolution of vivo global mall -- multilingual solution
Equipment encryption of industrial control security
Interviewer: do you understand redis' shared object pool?
New knowledge: monkey improved app crawler
One article to show you how to understand the harmonyos application on the shelves
Advanced data storage
About MySQL password modification failure
Colorize Voronoi Diagram Template
河南中创|从云到边,边缘计算如何赋能数据中心
Entity class dto to VO is converted through plug-in
Article 3: Design of multifunctional intelligent trunk following control system | undergraduate graduation project - [defense ppt]
Elegant throttling / de buffeting decorator under LAYA
Streaming data warehouse storage: requirements and architecture
MATLAB basic application 02 wind stock data introduction and use case:
Kmeans from 0 to 1
Defect detection, introduction to Halcon case.