Sobes.tech
Middle+

How did you define the boundaries of a service, where it should start and end?

sobes.tech AI

Answer from AI

Service boundaries are defined based on business logic and the responsibilities it must bear. Usually, a service begins where a separate business function or data aggregate appears, and ends where another, independent function begins.

To determine service boundaries, it is useful to:

  • Identify bounded contexts — areas where terminology and logic are unambiguous.
  • Define which data and operations belong to the service and which belong to external systems.
  • Minimize dependencies between services so they can develop and scale independently.

For example, in an online store, you can identify services such as "Orders," "Payments," "Product Catalog." The "Orders" service is responsible for creating, modifying, and storing orders but does not handle payment processing — that is a separate service.

In Go, this is often reflected in packages and interfaces, where a service implements a set of methods clearly limited to its area of responsibility.