当前位置:网站首页>[microservices] understanding microservices

[microservices] understanding microservices

2022-06-26 23:25:00 fate _ zore

Get to know microservices

Monomer architecture : Develop all the functions of the business in one project , Deploy as a package .

** advantage :** Simple architecture , Low deployment cost

** shortcoming :** High coupling degree ( Difficult to maintain 、 Upgrading is difficult )

image-20220622135031908

Distributed architecture : Split the system according to business functions , Each business function module is developed as an independent project , It's called a service .

** advantage :** Reduce service coupling , It is conducive to service upgrading and expansion

** shortcoming :** The service invocation relationship is complicated

image-20220622135031908

Although distributed architecture reduces service coupling , However, there are many problems to consider when splitting Services :

  • How to define the granularity of service splitting ?
  • How to realize remote call between services ?
  • How to manage the invocation relationship of services ?
  • How to perceive the health status of services ?
  • How to maintain the service cluster address ?

People need to formulate a set of effective standards to restrict distributed architecture .

Microservices

Architectural features of microservices :

  • Single responsibility : Microservices have smaller granularity , Each service corresponds to a unique business capability , Single responsibility
  • autonomous : Team independence 、 Technology independence 、 Data independence , Independent deployment and delivery
  • Service oriented : The service provides a unified standard interface , It has nothing to do with language and Technology
  • Strong isolation : Isolate service calls 、 Fault tolerance 、 Downgrade , Avoid cascading problems

img

The above features of microservices In fact, it is setting a standard for distributed architecture , Further reduce the coupling between services , Independence and flexibility in providing services . High cohesion , Low coupling .

therefore , It can be considered that microservice is a distributed architecture scheme with good architecture design .

Among them in Java The most striking thing in the field is SpringCloud The scheme provided .

Microservice structure

The solution of microservice needs a technical framework to implement , Internet companies around the world are actively trying their own microservice landing technology , The most famous in China is SpringCould Ali Dubbo

Microservice technology comparison

DobbospringCloudspringCloudAlibaba
Registry Center zookeeper,RedisEureka,ConsulNacos,Eureka
Service remote invocation Dubbo agreement Feign(http agreement )Dubbo,Feign
Configuration center nullSpringCloudConfigSpringCloudConfig,Nacos
The service gateway nullSpringCloudGateway,ZuulSpringCloudGateway,Zuul
Service monitoring and protection dubbo-admin, Weak function HystrixSentinel

image-20220622150036440

原网站

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