Genuine high availability requires a greater investment than those services that can tolerate more failure. This can often be preferable to hardening the entire service for high volumes. If you need to provide an interface that supports batch processes, then you may want to isolate this larger-scale processing in a different implementation.
Similarly, patterns such as Command Query Responsibility Segregation imply separate service implementations to accommodate different processing contexts. You may want to distinguish reporting from operational data, which tend to require very different styles of solution. Services can also be defined according to how they process data. If want services to be owned by a single team and use independent deployment pipelines, then this may also place practical limits on their optimal size. On the other hand, if you want services to be fully autonomous and look after their own data then this may imply a service that is large enough to encapsulate a self-contained business process. Bounded contexts tend to describe the largest grouping of capabilities that still maintain internal cohesion, so they may not be useful if you want your services to be relatively small. The desired characteristics of a service can help to determine its boundaries. Pragmatism should be a big part of service design and it makes sense to factor in a range of organisational and technical concerns into your boundaries. A classic example is a customer, where a billing service associates them with payment details, while a shipping service will only be interested in their delivery address.Īlthough DDD provides a useful theoretical framework to identify ideal service boundaries, many service implementations are driven by more practical concerns. There is also a recognition that different services will have different views of the same concept. The emphasis on capabilities is important, as services should be more than collections of data entities and CRUD methods.
#Domain driven design bounded context series#
It assumes that you can’t define a large and complex business domain in a single model, so you should break it down into a series of smaller, self-contained models, or "bounded contexts".Įach of these bounded contexts is a cohesive collection of data and behaviour that could represent a service boundary. Domain Driven Design (DDD) can provide a good starting point for discovering service boundaries.