Jump to content

Service granularity principle

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Bgwhite (talk | contribs) at 08:13, 22 April 2013 (References: Do general fixes and cleanup. - using AWB (9106)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Service Granularity is a design principle that identifies the optimal scope of business functionality in a service operation.

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.

The four key factors to consider when designing for optimal granularity are performance, message size, transaction 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.

Transaction

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