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

What are the common micro-service components and concepts

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

Share

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

This article introduces the knowledge of "what are the common micro-service components and concepts". Many people will encounter such a dilemma in the operation of actual cases. next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

What is the micro-service architecture?

In terms of image, micro-service architecture is like building blocks, each micro-service is a part, and use these parts to assemble different shapes. Generally speaking, micro-service architecture is to decompose a large system into multiple small systems with a single responsibility according to business functions, and use a simple method to make multiple small systems cooperate with each other into a large system. If the discipline is a little bit, the micro-service architecture is to aggregate the functions that change for the same reason, separate the functions that change for different reasons, and use lightweight mechanisms (usually HTTP RESTful API) to achieve communication.

Micro-service architecture is an architectural model, which advocates dividing a single application into a group of small services, which coordinate and cooperate with each other to provide users with the ultimate value. Each service runs in its own independent process, and the service and the service use a lightweight communication mechanism to cooperate with each other (usually RESTful API based on the HTTP protocol). Each service is built around a specific business, and can be independently deployed to the production environment, class production environment, and so on. In addition, for specific services, we should choose the appropriate language and tools to build them according to the business context. (extracted from Mr. Wang Lei's "Micro Service Architecture and practice")

For me personally, I prefer a continuity explanation, micro services architecture ≈ modular development + distributed computing. No matter what the definition of the micro-service architecture is, it describes a core idea: to split the large system into small systems, to reduce the complexity of the system, so as to greatly reduce the risks and costs of system construction, upgrade, operation and maintenance.

There is an essential difference between "micro-service" and "micro-service architecture". "micro-service" emphasizes the size of the service, it focuses on a certain point. On the other hand, "micro-service architecture" is an architectural idea, which requires overall consideration of the software system as a whole.

Common micro-service components and concepts

Service registration, the service provider registers its own call address with the service registry, so that the service caller can easily find himself.

Service discovery, the service caller finds the address of the service he needs to invoke from the service registry.

Load balancing, service providers generally provide services in the form of multiple instances, and the load balancing function enables service callers to connect to appropriate service nodes. Also, the work selected by the node is transparent to the service caller.

Service gateway, service gateway is the only entrance to service invocation, which can realize user authentication, dynamic routing, grayscale release, Amax B test, load current limit and other functions.

The configuration center registers the localized configuration information (properties, xml, yaml, etc.) with the configuration center to realize the indifference of the package in the development, testing and production environment, and to facilitate the migration of the package.

API management, writing and updating API documents in a convenient form, and for callers to view and test in a convenient form.

In the integration framework, micro-service components provide services as packages with a single responsibility, and the integration framework integrates all micro-service components (especially management-side components) into a unified interface framework in the form of configuration. enables users to use the system in a unified interface.

Distributed transaction, for important business, needs to ensure data consistency through distributed transaction technology (TCC, highly available message service, best effort notification).

The call chain records the micro-services that are called when a business logic is completed, and shows this serial or parallel invocation relationship. When the system goes wrong, the error point can be easily found.

After the supporting platform and the micro-service of the system, the system becomes more fragmented, and the deployment, operation and maintenance of the system are more complex than the single architecture, so it is necessary to automate most of the work. Now, tools such as Docker can be used to neutralize the disadvantages of these micro-service architectures. For example, continuous integration, blue and green release, health check, performance health, and so on. Seriously, with our two years of practical experience, it can be said that if there is no suitable supporting platform or tool, do not use the micro-service architecture.

What scenarios require a micro-service architecture?

Software research and development is a systematic project, it does not have silver bullets, can not be eaten all over the world with a single move. Just like CMMI and Agile methods at that time, Agile is good, but it may not be applicable to all scenarios. It has some requirements on organizational environment, team atmosphere, communication methods, and technical capabilities. If it is not used well, it will bring some negative effects.

When do we need to adopt microservices? From my personal experience, I think there are three scenarios where microservices can be considered.

Large scale (more than 10 people in the team)

High business complexity (the system has more than 5 sub-modules)

Long-term evolution is required (project development and maintenance cycle is more than half a year)

The horizontal axis is complexity and the vertical axis is production efficiency. From the perspective of production efficiency, before the intersection of the two curves, the single architecture is dominant, after the intersection, the production efficiency of the single architecture will be greatly reduced.

This is the end of the content of "what are the common micro-service components and concepts". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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