当前位置:网站首页>System design: Agent & redundancy & replication
System design: Agent & redundancy & replication
2022-06-24 05:03:00 【Xiaochengxin post station】
agent
A proxy server is an intermediate server between a client and a back-end server . The client connects to the proxy server to request a web page 、 file 、 Connection and other services . in short , A proxy server is a kind of software or hardware , Act as a mediator for clients seeking resource requests from other servers .
Usually , The proxy is used to filter requests 、 Record request , Or sometimes conversion requests ( By adding / Delete the header 、 encryption / Decrypt or compress resources ).
Another advantage of proxy server is that the cache can handle many requests . If multiple clients access a specific resource , The proxy server can cache this resource and provide it to all clients , Without having to access the remote server .
So when to use it ? It is used here for all the promotion scenarios , For example, let me give a more specific example . The author once worked in Jingdong , I will take Jingdong as an example , Jingdong's APP The homepage directly exposes all JD users , In particular, hundreds of millions of users may be active during the promotion , Also participate in product promotion 、 seckill , So for these hot commodities , How do we deal with it ?
There is no doubt that there should be an access gateway , Why? ? Because the three sharp tools of big promotion are caching 、 Current limiting 、 Downgrade . So sometimes you will find that the page is returning to you. Now the page fault is recovering , Downgraded . For example, sometimes you find yourself busy , Please do not click repeatedly , Current limiting . And sometimes , You find that you clearly see commodities , But when I placed the order, I found it was gone , Because the inventory has been sold out when the cache is synchronized .
So how does the gateway handle it ? Often is Nginx+Lua proxy server + Three level cache .
Proxy server type
The proxy can reside on the client's local server , It can also reside anywhere between the client and the remote server . Here are some famous proxy server types :
Open agent
An open proxy is any Internet A proxy server that users can access . Usually , The proxy server only allows netgroups ( Closed agent ) User store and forward in DNS Or Internet services such as web pages , To reduce and control the bandwidth used by the group . however , Use open proxy ,Internet Any user on can use this forwarding service . There are two well-known types of open proxies :
1. Anonymous proxy - These agent revisions are published on the server , But there is no resolution IP Address . For example, our domain name DNS It actually hides our internal servers IP Address .
2. Transparent proxy - Like our VIP It's actually our IP Address mapping .
Reverse proxy
The reverse proxy retrieves resources from one or more servers on behalf of the client . These resources are then returned to the client , It looks like they come from the proxy server itself
redundancy
Redundancy refers to the replication of key components or functions of the system in order to improve the reliability of the system , Usually in the form of backup or fault protection , Or to improve the actual system performance . for example , If only one copy of a file is stored on a server , Then losing the server means losing the file . Because losing data is rarely a good thing , We can solve this problem by creating duplicate or redundant copies of files .
Redundancy plays a key role in eliminating single point of failure in a system , And provide backup in case of crisis . for example , If there are two service instances running in the production environment , And one of them is out of order , Then the system can fail over to another .
Copy
Replication means sharing information to ensure redundant resources ( Such as software or hardware components ) Consistency between , To improve reliability 、 Fault tolerance or accessibility .
Replication is widely used in many database management systems (DBMS), There is usually a master-slave relationship between the original and the copy . The master gets all updates , Then pass the update to the master slave server . Each slave outputs a message , Indicates that it has successfully received updates , This allows subsequent updates to be sent .
Added by the author
In fact, in essence , The proxy server is equivalent to our privacy , That is, the high cohesion of software design principles 、 Low coupling . We act as an agent , It can easily screen out some things we don't want to pay attention to ( Such as authentication 、 cache 、 Polymerization, etc. ), We can focus more on our own business . Redundancy is actually a state after replication , We are trying to achieve redundancy to improve our high availability , That's why we choose master-slave replication . A similar idea is to preserve replicas between different clusters , such as ES The use of copies .
Reference material
grok_system_design_interview.pdf
边栏推荐
- Use of go testing framework gomock
- How does the mobile phone remotely connect to the ECS? What should be paid attention to during the operation
- Elfk service setup
- Critical service failed
- Analysis on the subjective enthusiasm of post-90s makers' Education
- 011_ Cascader cascade selector
- Black horse programmer machine learning handout: preliminary use of linear regression API
- 解析90后创客教育的主观积极性
- GDB debugging container and command saving
- Facebook internal announcement: instant messaging will be re integrated
猜你喜欢

线性回归的损失和优化,机器学习预测房价

SAP MTS/ATO/MTO/ETO专题之七:ATO模式1 M+M模式策略用82(6892)

Introduction to gradient descent method - black horse programmer machine learning handout

What is the new generation cloud computing architecture cipu of Alibaba cloud?

Loss and optimization of linear regression, machine learning to predict house prices

『渗透基础』Cobalt Strike基础使用入门_Cobalt Strike联动msfconsole

梯度下降法介紹-黑馬程序員機器學習講義

解析后人类时代类人机器人的优越性

Popularization of children's programming education in specific scenarios

Idea creates a servlet and accesses the 404 message
随机推荐
Black horse programmer machine learning handout: preliminary use of linear regression API
5g and industrial Internet
线性回归的损失和优化,机器学习预测房价
Blackmail virus prevention guide
MySQL cases MySQL find out who holds the row lock (RC)
SAP mts/ato/mto/eto topic 10: ETO mode q+ empty mode unvalued inventory policy customization
Weak current engineer, 25g Ethernet and 40g Ethernet: which do you choose?
Jimureport building block report - expression introduction
SAP mts/ato/mto/eto topic 7: ATO mode 1 m+m mode strategy 82 (6892)
After purchasing Tencent ECs, how to solve packet loss in Internet access?
What domain names do not need to be filed? Is there any process for domain name registration
Precautions for online education and training industry filing
Customer disaster recovery case - a MySQL database migration scheme
Bi-sql order by
"Emergency response practice" logparser log analysis practice
CTF learning notes 17:iwesec file upload vulnerability-02 file name filtering bypass
What is the domain name of the website? How much is a domain name
Jimureport building block report - what problems does the layout design solve?
Introduction to vulnerability priority technology (VPT)
黑马程序员机器学习讲义:线性回归api初步使用