Cloud-Native Applications in Java
上QQ阅读APP看书,第一时间看更新

Service granularity

Here are the types of services:

  • Atomic or system services: These are the services that do a unit level of work and are enough to service the request by either referring to a database or a downstream source.
  • Composite or process services: These services depend on the coordination between two or more atomic services. Typically, composite microservices are discouraged unless the business case already involves using existing atomic services. An example is a credit card payment from a savings account that calls two services, one to debit the savings account, and an other to credit the card account. Composite microservices also introduce inherent complexity such as state management and transactions that are difficult in a distributed scenario.
  • Experience services: These services are tied to the customer journey and are deployed at the edge of the infrastructure. These services handle requests from the mobile and web applications. These services are exposed through a reverse proxy using tools such as API gateways.