当前位置:网站首页>Developers, what is the microservice architecture?

Developers, what is the microservice architecture?

2022-06-26 10:26:00 Prince

🧑‍ author : Sophomore computer student
Home page : Focus on learning more technologies
The key : Microservices software development framework Concept

Hello everyone , What we share today is the architecture of the enterprise , Microservice architecture , After reading this article , I believe you will have a much clearer concept of microservice , I am a little weeks , If you think the article is well written , Remember that Sanlian supports poor bloggers

 Insert picture description here

Monomer architecture

 Insert picture description here

Let's talk about what a microservice architecture is , Too hard to avoid , Any new technology is born more or less for a reason , So before we talk about the microservice Architecture , I think we should start with the concept of single architecture and its advantages and disadvantages .

Speaking of monomer Architecture , My most contact is MVC framework , The advantage is that the learning cost is low , Quick start , test 、 Deploy 、 Operation and maintenance are also more convenient , Even one person can complete the development and deployment of a small website .

With MVC Architecture, for example , Business is usually done by deploying a ( Circle the point )WAR Package to Tomcat The server , start-up Tomcat Listening to a port can provide external services , Early in the business scale is not big 、 When the team is small , Monomer architecture is a good choice .

However, with the continuous expansion of business scale , The number of team members is increasing , Some problems will begin to appear in the single architecture . For example, the cost of teamwork becomes higher , Once the business goes wrong , Almost all relevant developers are involved in solving , inefficiency , The high cost , The availability of the system becomes poor , Because all businesses are packaged and deployed together , Once there is a problem with the code or resources involved in a function , It will affect the whole WAR Features deployed in the package , Is very serious . Inefficient deployment , There are more and more single application codes , Dependence is also increasing , The time for application deployment test is enough for me to fight against the wind . Business growth , The service will take longer to start , The online speed is a headache ……

therefore , There is an urgent need for a new architecture that can decouple different modules of the application , Reduce development, deployment and maintenance costs , The idea of service came into being , Microservices , It can greatly improve the efficiency of application delivery !

As a service

In short , Servitization refers to the traditional single application JAR Package dependency generates local method calls , Transform to pass HTTP Of REST API Remote interface call .

I can see you , Through servitization , It can improve the expansion of monomer application , The system is highly coupled , Low efficiency of cooperation and so on .

Microservice architecture

 Insert picture description here

Thanks to Docker Represented by the maturity of containerization technology and DevOps The rise of culture , The idea of service further evolved into today's well-known microservice architecture .

DevOps It's a kind of emphasis “ Software developer (Dev)” and “IT Operation and maintenance technicians (Ops)” Communication and cooperation between cultures 、 Sports or practices , Through automation “ Software delivery ” and “ Architectural change ” The process of , To make the build 、 test 、 Distributing software can be faster 、 Frequent and reliable .

What are the characteristics of microservices ?

  • Service splitting is more granular , Micro service can be said to be a finer dimension of servitization , Down to a submodule , Each service usually focuses on a particular business 、 Small amount of code required , Low complexity 、 Easy to maintain
  • Service independent maintenance , Each microservice can be developed by a small team or even an individual 、 test 、 Release and operations , And responsible for the entire life cycle
  • Team size , Under microservices, each service is developed separately , Deployment and maintenance . Each service starts from design , The team from development to maintenance is small , Team management is easy , The cost is small
  • Data storage mode , Different microservices can use different data storage methods , For example, some use mysql, Some use redis……
  • Development mode , In microservices , Different modules can be developed using different technologies or languages , The development mode is more flexible
  • As long as there is any modification to the application with single architecture , You need to redeploy the entire application to take effect , Microservice perfectly solves this problem . In the micro Service Architecture , After a micro service is modified , Just redeploy the service , Without having to redeploy the entire application
  • Microservices can work with containers (Docker) In combination with , Implement fast iterations 、 Fast build 、 Rapid deployment
  • Microservices have good scalability , As the business grows , The volume and code volume of microservices will increase dramatically , At this point, we can split the microservice again according to the business ; besides , When the number of users and concurrency increases , We can also deploy microservices in clusters , So as to increase the load capacity of the system

thus it can be seen , Microservice is used to publish and deploy services , And the maintenance of the service brings many benefits .

Microservice framework

Microservice architecture is a system architecture style and idea , In reality, I want to build a micro service system , We need the support of microservice framework . With the popularity of microservices , Many programming languages have launched their own microservice frameworks , such as :

Java Microservice framework

Spring Cloud: be based on REST Services to build services , Help architects build a complete set of micro service technology ecological chain
Spark: first-class Java One of the microservice frameworks , The framework supports Java 8 and Kotlin Create an application for the microservice Architecture
Dubbo: Open source distributed service framework from Alibaba
……

Go Language microservice framework

Go There are few microservice frameworks in the language , More commonly used are GoMicro, It's a RPC frame , With load balancing 、 Service discovery 、 Synchronous communication 、 Asynchronous communication and message coding

Phyton Microservice framework

Phyton The microservice framework in mainly includes Flask、Falcon、Bottle、Nameko and CherryPy etc.

There are many languages , Each has its own microservice framework , Here is not a list , Bloggers are familiar with Spring Cloud

summary

Services evolve from single architecture applications to service-oriented split development and deployment , Later, with the continuous expansion of the scale of mobile Internet , agile development Continuous delivery DevOps The development and practice of culture , And based on Docker The continuous maturity of containerization technology , Refine services , Microservice architecture is becoming popular , It has gradually become the future evolution direction of application architecture .

A brief summary , Microservice architecture is the fine-grained service splitting of complex and huge single applications , Each split service is assigned to a small team for development, operation and maintenance , After completion, they are separately packaged and deployed , Thus, the efficiency of application delivery and the difficulty of maintenance iteration are greatly improved , Therefore, it is gradually adopted by major Internet companies .

At the end

Read here , You must have a basic understanding of microservices , The author's ability is limited , If the article is wrong , Please also point out that , Last , I hope you can lay a good foundation , Feet on the ground , Come on boy , Don't forget that Sanlian supports poor bloggers , I am a little weeks , Looking forward to your attention .

 Insert picture description here

原网站

版权声明
本文为[Prince]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260934288002.html