Service granularity principle
![]() | This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. (May 2011) |
Service granularity is a key design concern when applying the paradigm of service-orientation and in service-oriented modeling. Service granularity specifies the scope of business functionality and the structure of the message payload in a service operation that is provided within a Service-oriented architecture
Interpretation
By definition a coarse-grained service operation has broader scope than a fine-grained service, although the terms are relative. The former typically requires increased design complexity but can reduce the number of calls required to complete a task.
Many forces influence the service greanularity deisgn; four particularly relevant factors to consider when designing for an adequate granularity are performance, message size, transactionality and business function.
Performance
Web services are accessed remotely and calls to web service operation create more network overhead. Reducing the number of service requests reduces that overhead.
Message size
Coarse-grained services may pass more data than fine-grained services, including data that is not specifically required for the task. Reducing message size may require adding a more fine-grained operation.
Transactionality
For conceptual clarity each service operation should perform a single transaction. This also simplifies error recovery, and typically eases design.
Business function
Ideally, each service operation maps to a single business function, although if a single operation can provide multiple functions without adding design complexity or increasing message sizes, this generality can reduce implementation and usage costs.
References
- http://serviceorientation.com/soaglossary/service_granularity
- Cooking EA - Service Granularity
- IEEE Case Study on The Role of Service Granularity in A Successful SOA Realization
- Getting Web Service Granularity Right provides information about Service Granularity Principle and useful advice about how to get it right.
- SOA Practitioner's Guide
- Solving the Service Granularity Challenge
- Coarse-grained interfaces
- A Metrics Framework for Evaluating SOA Service Granularity