Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand micro-service

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to understand micro-services, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can gain something.

What is a microservice?

Microservice is an architectural style.

It can help you quickly expand your development team through strong module boundaries and independent deployment.

In fact, micro-service itself is not a new technology, but with the continuous development of the business, the business is constantly layered and split.

It is recognized by the industry as the main way to build Internet applications in the era of cloud computing, and it is a theme that every technician must face.

Why use microservices?

(1) for example, different businesses of the company will have different management background, and each background has login, registration, rights management, log management and other modules.

These modules are basically similar in different systems, and there is no need to copy the code every time.

So, develop a micro-service, manage the basic module.

(2) for example, with the increasing concurrency of business, the number of accessing DB is too large, so you need to consider introducing a cache layer.

Because there is no unified caching service, each business line develops its own cache layer.

Everyone is doing repetitive work, and a little carelessness may cause conflicts in caching KEY, resulting in data confusion.

So, develop a microservice that manages the cache layer.

(3) for example, each business line operation database can be directly spliced SQL query.

So the less experienced development engineer wrote an inefficient SQL.

It leads to the direct jam of the full table scan, which directly affects the availability of other business line systems.

It is difficult for DBA to locate which business group SQL is. Every time you tune SQL, you need to greet all business groups.

So, develop a micro-service to implement the data access layer.

(4).

There are many more application scenarios.

You can split the services according to their respective business.

What should be considered in the development of microservices?

(1) to measure the need for the use of micro-services?

Microservices are not suitable for everyone, because there are few technicians or there are not many projects, there is no need to develop microservices.

(2) consider how independent the service is?

How small micro-services need to be, this is based on their own business situation, there is no unified standard.

Micro-service is not as small as possible!

Design principle: provide convenience for yourself, not dig your own hole.

(3) whether to monitor micro-services in real time?

With more and more business, more and more concurrent traffic, visits, storage and so on.

Need to consider the real-time monitoring of micro-services, consider the need for capacity expansion, performance tuning and so on.

(4) how can microservices be tested?

Microservices use more business units, so how can they be easily tested when new business units use them?

In the course of testing, how to fix problems without affecting other businesses?

For practical consideration, it is best to provide test cases.

(5) how to govern microservices?

As there are more and more micro-services in the project, how should services like "Pansidong" be managed?

Specific problems, specific analysis, I do not have specific ideas, welcome to discuss.

How to invoke microservices?

HTTP interface or RPC.

You can try both of these methods, and choose the one that is more suitable for you.

As for the difference between these two ways, I am afraid that people will be more confused after I have explained it.

I personally recommend RPC (remote procedure call Protocol).

RPC is just like calling a local method, which is more convenient for the caller.

There are many RPC open source frameworks, and you can choose the one that suits you according to your own development language.

Common RPC frameworks in PHP: phprpc, yar, thrift, gRPC, swoole, hprose.

The above content is how to understand micro-services. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report