微服务及微应用拆分原则
This post defines microservices via seven tenets, reverse-engineered from books, articles and blogs. It also recapitulates which Service-Oriented Architecture (SOA) principles and patterns I collected to introduce SOA between 2003 and 2009. Such consolidated definitions are required to analyze the SOA style and microservice-based SOA realizations objectively.
这篇文章通过从书,文章和博客反向工程的七个原则定义了微服务。 它还概述了我在2003年至2009年之间收集的用于介绍SOA的面向服务的体系结构(SOA)的原理和模式。这些合并的定义对于客观地分析 SOA风格和基于微服务的SOA实现是必需的。
微服务中有什么? (What Is in a Microservice?)
My paper “Microservices Tenets: Agile Approach to Service Development and deployment” , published in a scientific journal but also openly available, compares several early definitions and distills seven tenets from them:
我的论文“微服务原则:服务开发和部署的敏捷方法”发表在科学期刊上,但也公开提供,比较了几个早期定义并从中提炼出七个原则:
Here is a slightly updated version of these tenets (I prefer the term “tenets” over “characteristics” or “principles” here to indicate that I do not intend to provide a formal, strict definition but report common industry practices):
以下是这些原则的略微更新版本(我在这里倾向于使用“原则”,而不是“特征”或“原理”,以表示我不打算提供正式,严格的定义,而是报告通用的行业惯例):
Fine-grained, message-based remote APIs expose independently deployable, scalable and changeable services each having a single responsibility.
- Business-driven development is applied (for instance, domain-driven design) so that each service represents and models a business capability. 应用业务驱动的开发(例如,域驱动的设计),以便每个服务代表并建模业务能力。
Services encapsulate their own state, IDEALly in a loosely coupled fashion (which is a cloud application architecture design principle).
服务以松散耦合的方式(这是云应用程序体系结构设计原理)封装自己的状态,即IDEAL 。
- Programming and persistence are polyglot, and communication technologies are also chosen in a