
上QQ阅读APP看书,第一时间看更新
Microservice identification
The name microservice does not necessarily mean that the service has to be small in size. But it has the following characteristics:
- Single responsibility principle: This is the core design principle of microservices. They should do one business unit of a task and do it completely. If there is low coupling, the services will be easier to modify and deploy or even replace altogether.
- Granular: Microservice granularity is contained within the intersection of a single functional domain, a single data domain and its immediate dependencies, a self-sufficient packaging, and a technology domain.
- Bounded: A service should have access to resources within its bounded context, which is managed by the same team. However, it should not access resources of other modules, such as cache and databases, directly. If a service needs to access other modules it should do so through an internal API or service layer. This helps reduce coupling and promotes agility.
- Independent: Each microservice is developed, tested, and deployed independently, in its own source. It can use third-party or shared libraries.