当前位置:网站首页>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
边栏推荐
- Pointer array parameter passing, pointer parameter passing
- Share how to make professional hand drawn electronic maps
- php实现根据输入的年龄查询出生日期符合的数据
- 电商系统微服务架构
- New feature of go1.18: trylock, which has been tossed n times
- Technological Entrepreneurship: failure is not success, but reflection is
- [shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
- 杰理之直接触摸样机的顶针反应不正常【篇】
- Oracle-PL/SQL编程
- 杰理之样机在多次触摸后会触发关机【篇】
猜你喜欢
建立自己的网站(22)
任务和特权级保护
Phpcms realizes the direct Alipay payment function of orders
Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
NC50965 Largest Rectangle in a Histogram
UE4 game architecture learning notes
wait解决僵尸进程
[shutter] shutter application theme (themedata | dynamic modification theme)
附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
[shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)
随机推荐
任务和特权级保护
Task and privilege level protection
#include errors detected. Please update your includePath.
Phpcms realizes the direct Alipay payment function of orders
Technological Entrepreneurship: failure is not success, but reflection is
[LeetCode] 回文数【9】
Market Research - current situation and future development trend of preclinical medical device testing service market
Pointer - function pointer
Unity3d learning notes 4 - create mesh advanced interface
Source code analysis - lightweight asynchronous crawler framework Ruia
U++ 学习笔记 ----松弛
杰理之样机无触摸,拆机之后重新安装变正常【篇】
php实现根据输入的年龄查询出生日期符合的数据
Pointer and string
Market Research - current market situation and future development trend of aircraft audio control panel system
Market Research - current situation and future development trend of anti-counterfeiting label market
影视随摘
uniapp微信登录返显用户名和头像
[QT] QT multithreading development - four methods to realize multithreading design
[001] [arm-cortex-m3/4] internal register