Is Microservice design pattern or architecture?

感情迁移 提交于 2019-12-02 04:20:22

问题


After doing rigorous research and analysis I finally arrived to a point which is confusing me "Is Microservice a design pattern or architecture". Some say it's a pattern evolved as a solution to monolithic applications and hence design pattern And some confirms no doubt it's an architecture which speaks about their development, management, scalability, autonomous & full stack. Any thoughts or suggestions I welcome to get myself clarified.


回答1:


Microservices can be best described as an architectural style. Beside architectural decisions the style also includes organizational and process relevant considerations.

The architectural elements include:

  1. Componentizing by business concern.
  2. Strict decoupling in terms of persistence.
  3. Well defined interfacing and communication.
  4. Aim for smaller service sizes.

The organizational elements include:

  1. Team organization around components (Conway's Law).
  2. Team size limitations (two-pizza team).

The process relevant elements include:

  1. Less centralized governance.
  2. Smaller, more frequent releases.
  3. Higher degree of freedom for technology decisions.
  4. Product oriented development (agile, MVP, lean, etc).

For more details I recommend reading the articles from Martin Fowler.




回答2:


I would describe it as a software architectural style that require functional decomposition of an application.

Usually, it involves a monolithic application is broken down into multiple smaller services, each deployed in its own archive, and then composed as a single application using standard lightweight communication, such as REST over HTTP or some async communication (of course, at some point micro services are written from scratch).

The term “micro” in microservices is no indication of the line of code in the service, it only indicates the scope is limited to a single functionality.

Each service is fully autonomous and full-stack. Thus changing a service implementation has no impact to other services as they communicate using well-defined interfaces. There are several advantages of such an application, but its not a free lunch and requires a significant effort in NoOps.

It's important to focus on that that each service must have the properties of:

  • Single purpose — each service should focus on one single purpose and do it well.
  • Loose coupling — services know little about each other. A change to one service should not require changing the others. Communication between services should happen only through public service interfaces.
  • High cohesion — each service encapsulates all related behaviors and data together. If we need to build a new feature, all the changes should be localized to just one single service.


来源:https://stackoverflow.com/questions/48677693/is-microservice-design-pattern-or-architecture

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!