当前位置:网站首页>Talk about your understanding of microservices (PHP interview theory question)
Talk about your understanding of microservices (PHP interview theory question)
2022-07-05 14:59:00 【Back end regular developers】
Catalog
brief introduction
Learning links for reference
- Microservice design
- Cloud native distributed storage cornerstone :etcd In depth analysis of
- Docker Introduction to technology and actual combat
- Every day 5 Minutes to play Kubernetes
- The left ear to listen to the wind
- from 0 Start learning about microservices
One 、 What is microservice architecture ?
Microservice is an architectural concept , It aims to realize the decoupling of solutions by decomposing functions into discrete Services . You can think of it as applying a lot more at the architecture level than on the classes that get services SOLID principle . Microservice architecture is a very interesting concept , Its main function is to decompose functions into discrete Services , So as to reduce the coupling of the system , And provide more flexible service support .
Concept : Split a large single application and service into several or even dozens of support services , It can extend a single component rather than the entire application stack , So as to meet the service level agreement .
Definition : Create applications around business domain components , These applications can be developed independently , management , And iteration . Use Cloud Architecture and platform deployment in distributed components , Management and service functions . Make product delivery easier .
The essence : Use some functions to be clear , The service area with relatively refined business is larger , More practical questions
Two 、 Reasons for appearance
Why does microservice appear ? I think this is the inevitable result of the development of the Internet .
As never before IOS Seven layer model , Programmers at that time did programming , They need to do what the seven layer model does , This is something every programmer needs to do , A lot of waste of resources , And everyone's effect is hard to say perfect . then IOS Seven layer model appeared , Unified specifications help programmers complete repetitive work , Greatly improved development efficiency .
In that case , Microservices do the same thing .
The Internet has experienced decades of development , The head company is huge , Encounter a lot of problems , Every enterprise may encounter these problems . In many things, we are building wheels repeatedly , And many times it may not be done very well . On the basis of absorbing excellent practice , Combine your extensive knowledge , Promote the development of micro Services .
At present, it is still difficult to form a unified standard for microservices , First, from the perspective of the whole development stage , It is still in its infancy , There are not a large number of relevant microservice talents , Second, the business situation of each company is different , It is difficult to completely unify . however , In fact, microservices have become a prairie fire , In the near future , It may be easier to start an Internet company , Microservices will be like TCP/IP equally , It is completely transparent to developers , Developers only need to focus on developing business logic , Of course , The premise is to develop to this stage , If you still need programmers .
Develop this universal microservice platform , It's also a very good entrepreneurial direction .
So as a contemporary programmer , Learning micro services is still necessary , This is the inevitable trend , Can also increase their competitiveness . If one day , Microservices and TCP/IP As transparent as before , People who understand the core principles of micro services are still more valuable , After all, only these people can solve some magical problems .
3、 ... and 、 system
The water of micro service is very deep , Accurately speaking , It's not only deep but also very wide . Microservices involve a lot of content , And each piece can be studied in depth , Become an expert in this area .
stay 《 Microservice design 》 In this book , Microservices are defined as : Microservices are small, autonomous services that work together .
This definition is not particularly good , I always feel that the scope of micro services has been narrowed .
In addition, there is a big gap in the understanding of this sentence with different experience . I remember I used to have a comment system , Comment service 、 Comment backstage 、DB、 Caches are deployed independently , At that time, I thought this comment system was a micro service . So it's not 100% wrong , But it is certainly not right .
Because microservices describe a whole set of systems , A single independent service , Only a small part of micro Services .
Microservices mainly consist of 6 Part of the form
- The service description
Documentation for similar services , Simple but indispensable . such as , The first problem to be solved by service invocation is how to describe the service externally . such as , You have provided a service , What is the service name of this service ? What information needs to be provided to call this service ? What format is the result returned by calling this service ? How to analyze ? These are the problems to be solved by the service description .
- Registry Center
With the interface description of the service , The next step is to solve the problem of service publishing and subscription , That means you provide a service (Provider), How to make the outside (Consumer) People who want to call your service know . A similar registry is needed at this time (Registry) Role , Service providers register their services and addresses with the registry , The service consumer queries the registry for the address of the service to be called , Then make a request .
- Service Framework
Through the registry , The service consumer can get the address of the service provider , When you have an address, you can initiate a call . But before you start the call, you need to solve the following problems . What protocol is used for service communication ? yes RESTful API still gRPC? What method is used for data transmission and what format is used for data compression ? These activities are usually integrated into our service framework , There are many such open source frameworks on the market , They are relatively mature , The next test is your ability to get started quickly .
- Service monitoring
Once the service consumer and service provider can normally initiate service invocation , You need to monitor the call , To find out if the service is normal . Generally speaking , Service monitoring mainly includes three processes , Index collection , Data processing , Data presentation . Monitoring is to find problems and anomalies , If you want to further track and locate the problem , You need to learn more about service tracking .
- Service tracking
In addition to the need to monitor service invocation , You also need to record every link that the service calls through , For problem tracking and fault location , Finally, the goal of approaching the problem . Service monitoring and tracking can be combined , But to be clear about their respective responsibilities is not the same .
- Service governance
Service monitoring can find problems , Service tracking can locate the problem , And solving the problem depends on Service Management . Service governance is to ensure that in all kinds of unexpected situations , Service calls still work . On the current open source service framework , Most of them do not include service governance , So it is possible that you and your team need to carry out customized development , It depends on how well you do it , It's like you have a database but you don't ER The picture describes , It does not affect your use of microservices , Of course, if there is one, it is the icing on the cake .
this 6 Part of it is called microservice when combined . The following link is a mind map I made , I haven't completely learned some contents in the map , In the later stage, it will be further sorted out , If you like , You can remember this link first .
https://www.processon.com/view/link/5f3952a17d9c0806d41a90a9
Four 、 The advantages of microservice Architecture
Effective split application , Implement agile development and deployment
The division of different , In the past, we may have one module for each person , Now it could be one person, one system
Different architectures , Service splitting is a high-tech problem , Whether the split is reasonable or not has great influence on the future development
Different deployment methods , If we deploy as before, we're exhausted , Automatic operation and maintenance
Different disaster tolerance , A good microservice can isolate faults and avoid the overall collapse of the service , Bad microservice design can still cause a chain reaction due to a problem with a subservice
Extension is different , Microservices are easier to expand horizontally and vertically according to demand
What microservices do is to split services according to project granularity , Take out the modules separately to make each individual small project . The main features of microservices are :
Each function module is a small project , Run independently on different processes or machines , Different functions can be developed by different people independently , Independent deployment does not need to rely on the overall project to start a single service , Distributed management , Just do your own thing for each service , When designing microservices, you need to consider databases , Whether all services share one database or one service and one database .
5、 ... and 、 Disadvantages of microservices
Because of the complexity of the microservice architecture , High technical requirements , So we should consider whether the team already has relevant technology
Whether the company's business is suitable for microservice transformation , Not all of them are suitable , Traditional industries have many complex vertical business structures .
There are many technologies of micro service ecosystem , Not every technical solution needs to be used , What suits you is the best
For microservice Architecture : It's not a technical problem , Consciousness is more important than tools !
What is? RPC?
A lot of traditional phper Don't know what is rpc,RPC Full name Remote Procedure Call, Remote procedure call , In fact, you can understand it as an architectural design , Or a solution .
adopt RPC We can call methods on other machines as we call local methods , Users will not feel the communication between servers ,RPC It plays a considerable role in microservices
6、 ... and 、 Learning route
Microservice is a master of modern Internet technology . I'm a beginner , You need to establish a learning route for yourself , This can help you better master the content .
For the learning route , I think there are several principles :
Find out what you must learn and take notes
I have read many articles or books before , But I didn't write down the content , I always feel that I have learned a little , Digest the content and write it out , Be able to impress
The necessary content should be the core content , image k8s、docker、 Distribution is 100% of what needs to be learned
You don't have to learn
There are multiple technology options for the same scheme , Just learn one . Such as service arrangement, just look k8s, Because this is already the industry standard . Service tracking can be done from zipkin and skywalking Choose one of them
Some contents are particularly inclined to the operation and maintenance level , You can understand a little or not at all
Constantly update and enrich the brain map
Learning process , Need to practice , Finally, we will build a basic micro service .
At present, the contents of planned learning and relearning are
- k8s
- docker
- Etcd
- GRPC
- Netty
- Dubbo
- ELK
- Grafana
- Kafka
- Skywalking
- Apollo
- Istio
In fact, in addition to these , There are many other things to learn about microservices , These contents can be supplemented slowly in the future .
边栏推荐
- JMeter performance test: serveragent resource monitoring
- 危机重重下的企业发展,数字化转型到底是不是企业未来救星
- Pointer operation - C language
- 我这边同时采集多个oracle表,采集一会以后,会报oracle的oga内存超出,大家有没有遇到的?
- 【招聘岗位】基础设施软件开发人员
- Photoshop plug-in - action related concepts - actions in non loaded execution action files - PS plug-in development
- R 熵权法计算权重及综合得分
- Microframe technology won the "cloud tripod Award" at the global Cloud Computing Conference!
- MongDB学习笔记
- Implement a blog system -- using template engine technology
猜你喜欢

【华为机试真题详解】字符统计及重排

有一个强大又好看的,赛过Typora,阿里开发的语雀编辑器

可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成

社区团购撤城“后遗症”

【NVMe2.0b 14-9】NVMe SR-IOV

Topology visual drawing engine

浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数

百亿按摩仪蓝海,难出巨头

Dark horse programmer - software testing -10 stage 2-linux and database -44-57 why learn database, description of database classification relational database, description of Navicat operation data, de

MySQL----函数
随机推荐
Select sort and bubble sort
leetcode:881. lifeboat
Shanghai under layoffs
MySQL----函数
超越PaLM!北大硕士提出DiVeRSe,全面刷新NLP推理排行榜
黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,
做研究无人咨询、与学生不交心,UNC助理教授两年教职挣扎史
启牛学堂班主任给的证券账户安全吗?能开户吗?
Explain Vue's plan to clean up keepalive cache in time
如何将电脑复制的内容粘贴进MobaXterm?如何复制粘贴
Implement a blog system -- using template engine technology
ICML 2022 | 探索语言模型的最佳架构和训练方法
【jvm】运算指令
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
想问下大家伙,有无是从腾讯云MYSQL同步到其他地方的呀?腾讯云MySQL存到COS上的binlog
有一个强大又好看的,赛过Typora,阿里开发的语雀编辑器
FR练习题目---简单题
Talking about how dataset and dataloader call when loading data__ getitem__ () function
1330:【例8.3】最少步数
开挖财上的证券账户可以吗?安全吗?