当前位置:网站首页>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
边栏推荐
- How to change the IP address of ECS? What are the precautions for changing the IP address
- 011_ Cascader cascade selector
- How does ECS select bandwidth? What types of servers do you usually have?
- Spirit breath development log (15)
- How to use and apply for ECS? What parameters can be configured
- LeetCode 1662. Check whether two string arrays are equal
- What are the functions of ASP files on ECs? What if the ECS cannot run ASP with a low version?
- How novices choose ECs and how to judge the quality of ECS
- Popularization of children's programming education in specific scenarios
- Spirit breath development log (16)
猜你喜欢

011_ Cascader cascade selector

CTF learning notes 17:iwesec file upload vulnerability-02 file name filtering bypass

梯度下降法介绍-黑马程序员机器学习讲义

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

Facebook内部通告:将重新整合即时通讯功能

Idea creates a servlet and accesses the 404 message

『应急响应实践』LogParser日志分析实践

Training methods after the reform of children's programming course

Analyzing the superiority of humanoid robot in the post human era

少儿编程教育在特定场景中的普及作用
随机推荐
Leetcode (question 1) - sum of two numbers
线性回归的损失和优化,机器学习预测房价
阿里云混合云首席架构师张晓丹:政企混合云技术架构的演进和发展
问题:sql创建存储过程
Oracle database prompts no operation permission
阿里云新一代云计算体系架构 CIPU 到底是啥?
How to create an FTP server on the ECS? Is it safe to create an FTP server on the ECS?
黑马程序员机器学习讲义:线性回归api初步使用
Deep learning NLP from RNN LSTM Gru seq2seq to attention classification and analysis
2021-08-27: the normal odometer will display natural numbers in turn to indicate mileage, Kyrgyzstan
Inventory of common tools used by dry goods | data journalists
Bi-sql where
cuDNN installation
Elfk service setup
IP and traffic reconciliation tool networktrafficview
Redis pipeline technology speed and efficiency increased by 5 times
The easyplayer player displays compileerror:webassembly Reason for instance() and its solution
What is an ECS? What is the difference between ECs and traditional servers?
CTF learning notes 18:iwesec file upload vulnerability-03-content-type filtering bypass
Where is the cheaper domain name? What should I pay attention to when buying a domain name?