Single responsibility
In theory, the single responsibility principle could be applied to a method, a class, or a service. However, in the context of microservices, it does not necessarily map to a single service or endpoint. A more practical approach could be to translate the single responsibility into a single business capability, or a single technical capability. As per the single responsibility principle, one responsibility cannot be shared by multiple microservices. Similarly, one microservice should not perform multiple responsibilities.
There could, however, be special cases where a single business capability is divided across multiple services. One such case could be managing the customer profile, where there could be situations where ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access