liveBook · Manning

Service

As explained in Microservices Patterns, Second Edition

A software component that provides a cohesive set of capabilities within an application.

In a microservice architecture, a service is an independently deployable component that implements one or more business capabilities, or subdomains. Services are loosely coupled so teams can change and deploy them with less coordination. section 1.3.1 section 7.1.1

A service has a boundary and responsibilities that shape how it collaborates with the rest of the application:

  • It contains one or more subdomains and exposes an API of operations and published events. section 7.2.2
  • It may invoke other services’ operations or consume their events; its database is typically private and hidden behind its API. section 7.2.2
  • It is packaged as a deployable unit and has its own deployment pipeline; isolated testing helps make it production-ready independently. section 1.3.1 section 1.3.2

Order creation

An Order Service can implement order management and expose createOrder(). To reserve credit, that operation can invoke reserveCredit() on a Consumer Service. section 7.2.2

Figure 7.2 A service consists of one or more subdomains. It has an API consisting of operations and events. It collaborates with other services by invoking their operations and consuming their events.
single microservice

Use the diagram to see how subdomains, APIs, operations, and events fit within a service and support collaboration between services. section 7.2.2

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines service boundaries and explains subdomains, APIs, operations, events, and private databases without detailing implementation internals.
Examples
Uses Order, Delivery, and Consumer services, with order creation invoking a credit-reservation operation.
What you can do after
Understand how a service’s subdomains, API, and private data boundary shape collaboration with other services.
How it connects
Connects services to microservice architecture, subdomains, APIs, events, and deployment pipelines.

Also explained in

Compare how 4 books explain service →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.