当前位置:网站首页>Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
2022-07-02 22:47:00 【InfoQ】
One 、 Preface
Two 、 Start with a roadside stall
- Her stall rarely has the phenomenon of waiting for dishes for a long time . Because the capacity of tables, chairs and benches in stalls is usually limited , Usually not so many guests , The upper limit of the total demand for food is basically fixed , Relatively good coordination .
- Smooth communication 、 Fast , This order string roars 、 It started over there . When you're ready, yell again , It's served .
- short 、 Easy to turn around . The reason why the couple chose to start from the roadside stall , Because the boat is small and easy to turn around . It's possible to work for a while and find that there are few passengers in this location , You can stop operating immediately or operate in another place .

- The number of requests that can be accepted is limited , First, there are not so many users in terms of demand , Second, the resources of start-ups are limited , Memory of the server 、CPU Configuration is limited .
- View layer of monomer application 、 Control layer 、 The persistence layer is all in one application , Call convenient 、 Fast response . There are no remote calls between services RPC, Respond faster , Specific to a service request, the response result is faster .
- Development of simple 、 Quick start 、 A team of three or five people is easy to manage and use . The boss decided to quit , You can turn around at any time , It doesn't hurt much .
3、 ... and 、 Restaurant opening and load balancing
- Recruit someone ? Chef, of course 、 The cashier's wife can do it by herself , The main reason is that the husband can't live , Yes , Then hire a cook .
- Don't let more guests stand and eat ? Rent a nearby store 、 Add more tables, chairs and benches .
- The little couple arranged three chefs for the restaurant ( Including husband ), That's enough . The wife willOrder NoTo chef Zhang 、Double orderFor chef li , Neither of them can do it , Then give the order to her husband . Anyway, outsiders don't have to pay for it , My family can take a break . She'll give it to whoever she says , She has her own algorithm .This pattern is “ Client load balancing ”, The wife calls... As a client “ The cook ” service , I'll remember how many chefs there are , Then forward the user request to one of the chefs according to its own algorithm . Our common Spring Cloud When each service requests other micro Services , Maintain a list of microservices inside , Then, according to the request target and algorithm, select a service from the micro service for remote service invocation .
- One day the two chefs put forward their opinions : It's too tired to do this. There's no free time , Or the husband does more , Or get a raise . The couple are not very strong now , It's better for the husband to do more . Then the wife doesn't have to remember “ The single and even numbers of the order ” 了 , Just use one app Enter customer order , The app It can realize the balanced distribution of orders to chefs .“ This pattern is “ Server side load balancing ””. For software architecture, this app Load balancer , The commonly used software load balancers are nginx、haproxy etc. . There are also some hardware load balancers , Better performance , Of course, the charge is also more “ good ”. The architecture is shown in the following figure :

- “ benefit ” That is, the processing capacity of the application has increased , Able to handle more orders .
- “ Disadvantages ” The cost of communication has increased , The original problem solved by yelling , Now we need to rely on app Forwarded ( Load Balancer ). Whether it's a remote service call , Or request forwarding is time-consuming .
Four 、 After dinner communication
边栏推荐
- Leetcode circular linked list (fast and slow pointer) code line by line interpretation
- UE4 UI adaptive screen
- Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
- 傑理之修改不需要長按開機功能【篇】
- Unity发布WebGL播放声音的一种方法
- [QT] QT multithreading development - four methods to realize multithreading design
- Notes on key vocabulary of the original English book biography of jobs (IX) [chapter seven]
- 大话云原生之负载均衡篇-小饭馆客流量变大了
- 牛客网:龙与地下城游戏
- 【AUTOSAR-DCM】-4.3-UDS $22和$2E服务如何读取和写入NVM数据
猜你喜欢

牛客网:龙与地下城游戏
![[foreign journal] sleep and weight loss](/img/81/42dcfae19e72a0bc761cb7a40fe5d5.jpg)
[foreign journal] sleep and weight loss

#include errors detected. Please update your includePath.

Mathematical modeling -- graph and network models and methods (I)

#include errors detected. Please update your includePath.

Graphic view frame
![[LeetCode] 数组中的第K个最大元素【215】](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[LeetCode] 数组中的第K个最大元素【215】

Objects and object variables

Task and privilege level protection
![NC24325 [USACO 2012 Mar S]Flowerpot](/img/cf/86acbcb524b3af0999ce887c877781.png)
NC24325 [USACO 2012 Mar S]Flowerpot
随机推荐
Market Research - current situation and future development trend of anterior cruciate ligament (ACL) reconstruction Market
[shutter] shutter gesture interaction (small ball following the movement of fingers)
Storage unit conversion
[QT] QT multithreading development - reentrancy and thread safety
JS solution for obtaining the width and height of hidden elements whose display is none
开发者分享 | HLS, 巧用AXI_master总线接口指令的定制并提升数据带宽-面积换速度...
[shutter] shutter application theme (themedata | dynamic modification theme)
Learn computer knowledge from scratch
SimpleITK使用——4. 奇怪的問題
[LeetCode] 数组中的第K个最大元素【215】
Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning
php优化foreach中的sql查询
Share how to make professional hand drawn electronic maps
Graphic view frame
《乔布斯传》英文原著重点词汇笔记(十)【 chapter eight】
Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
Unity publishes a method of webgl playing sound
大话云原生之负载均衡篇-小饭馆客流量变大了
数学建模——图与网络模型及方法(一)