Single Responsibility
The orders service owns shipment status; the email delivery service owns sending email. A change to email retries can be released without changing the service that marks orders shipped.
The principles can also guide service design. We can ask what each service owns, what it needs from other services, and whether a change in one requires changes in another.
Suppose the store runs orders and message delivery as separate services. When the orders service marks an order shipped, it publishes an OrderShipped event. A message broker delivers the event to email and push delivery services. Because these services can be deployed separately, they need to agree on the event’s data and meaning.
The orders service owns shipment status; the email delivery service owns sending email. A change to email retries can be released without changing the service that marks orders shipped.
The orders service publishes OrderShipped without naming its subscribers. Adding a push delivery service changes the broker’s subscriptions, while the orders service keeps publishing the same event.
A service-level parallel is replacing email service v1 with v2 while keeping the same input contract. V2 cannot require a new locale field in OrderShipped; older events lack it. It can use a default locale.
A broad OrderChanged event makes the email delivery service inspect shipment, payment, and refund updates. A specific OrderShipped event lets it depend on only the shipment information it needs.
The orders service publishes an order-domain event rather than calling an email provider. Delivery services translate OrderShipped into provider requests, so the orders service does not import their clients or vendor SDKs.
Separate services need reliable event delivery, retries, and compatible event formats. Those costs make sense when teams need to deploy or operate the services independently. Otherwise, the same responsibilities can stay separated inside one application.
Sources: AWS on events between services, Merson on design principles for services, Robinson on service contracts, and Martin on architectural boundaries.