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 is the development weapon of springboot micro service?

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

Share

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

In this issue, the editor will bring you what is the sharp tool for the development of springboot micro-services. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.

I. Micro services and micro service architecture

1.1) what is a microservice

Divide a single application into a group of small services, each small service will run in its own process, and the services communicate with each other through a lightweight communication mechanism (http's rest api), then each small service is a micro-service. Traditional single e-commerce applications, order, payment, users, goods, inventory and other modules are all in a project, if a module appears online bug, it will lead to the release of the whole version back. If a single application is split into a micro-service, such as order micro-service, user micro-service, commodity micro-service, integrated micro-service, etc., if an error occurs in a micro-service, it will not cause the entire version to fall back.

1.2) what is the micro-service architecture

Micro-service architecture is an architectural pattern (for service management of micro-services), which coordinates, coordinates and functions a group of small services. 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 RESTfulAPI based on the HTTP protocol). Each service is built around a specific business and can be independently deployed to a production environment

1.3) benefits of microservices

①: each service is sufficiently cohesive and small enough for the code to understand so that it can focus on a specified business function or business requirement (list of responsibilities)

②: development is simple and efficient, a service may be dedicated to only one thing, and micro services can be developed separately by a small team of 2 to 5 developers.

③: microservices can be developed in different languages.

④: easy to integrate with third parties, and microservices allow easy and flexible ways to integrate automatic deployment through continuous integration tools such as Jenkins,Hudson,bamboo.

⑤: microservices are just code for business logic and will not be mixed with HTML,CSS or other interface components.

⑥: each microservice has its own storage capacity and can have its own database. You can also have a unified database.

1.4) disadvantages of microservices

① developers have to deal with the complexity of distributed systems (distributed things)

②: the difficulty of multi-service operation and maintenance. With the increase of service, the pressure of operation and maintenance is also increasing.

③: system deployment dependency

④: Inter-service communication cost

⑤: data consistency

Second, the understanding of springboot

2.1) benefits

①, springboot can automatically configure with minimal resistance, eliminating a lot of template configuration in traditional Spring applications, without spending more effort on the configuration of spring, or even no configuration at all, and focus more on the functions of the application. Although spring added annotation scanning in 2.5, it still requires a small amount of spring configuration.

②, start-up dependence, what functions are needed, automatically introduce the relevant class libraries. Provide a large number of start-up dependencies, reducing the complexity of project dependence. According to the transmission of dependencies, it is convenient to manage in the face of version conflicts and compatibility.

③, embedded tomcat,jetty container, do not need to pack war package, put it into container to execute, directly java-jar xx.jar can start the project

④, Actuator view application status (health check)

2.2) shortcomings

The internal support for jsp in ① and springboot is not particularly ideal, while the view recommended by springboot is Thymeleaf

②, although springboot reduces some configurations, it actually uses more annotations on the corresponding configuration classes, which makes it more difficult to understand component dependencies and loading principles than before.

③ and starter are similar to a pluggable plug-in, encapsulating the dependence of maven and controlling the version, which makes it more difficult for beginners to understand the principle.

Third, the dependencies that need to be introduced in the springboot construction project

3.1) spring-boot-dependencies in spring-boot-starter-parent,spring-boot-starter-parent is introduced to control the version. We introduce some dependencies that do not need to write the version number. If there is no need to write the version number naturally, we need to write the version number.

3.2) spring-boot-starter-web relies on some dependencies needed for web development, such as spring-web and webmvc.

These are the sharp tools of the springboot micro-service shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, 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