Jump to content

Service granularity principle

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 178.199.42.97 (talk) at 07:52, 6 October 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Service granularity is a key design concern when applying the paradigm of service-orientation, for instance, 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 (SOA). Finding an adequate granularity is hard;[1] there is no single simple answer but a number of criteria exist (see below). A primary goal of service modeling and granularity design is to achieve loose coupling, which is one of the essential SOA principles.[2]

Definition

Service granularity is both a business domain concern (business granularity), as well as a software interface design issue (technical granularity); it is a property of the service contract exposed by a service provider. It pertains to the semantics and syntax of the in (request) and out (response) message content, which can be viewed as instances of two general Enterprise Integration Patterns, Command Message and Document Message 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.[3]

Criteria

Many forces influence the service granularity;[4] 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.

Many more decision criteria for finding an appoproprite granularity exiist; there is no global optimum.[5]

See also

References

  1. ^ F. Leymann Loose Coupling and Architectural Implications, ESOCC 2016 keynote,
  2. ^ Krafzig, D., Banke, K., Slama, D. (2004). Enterprise SOA: Service-Oriented Architecture Best Practices 1st Edition. Prentics Hall. ISBN 978-0131465756.
  3. ^ Josuttis, N. (2007). SOA in Practice. Sebastopol, CA, USA: O'Reilly. ISBN 978-0-596-52955-0.
  4. ^ Page 21 in Zimmermann, O., Guidance Models and Decision-Making Tooling for SOA, Cloud, and Outsourcing Solution Design, http://resources.sei.cmu.edu/asset_files/Presentation/2011_017_001_24654.pdf
  5. ^ Pautasso C., Wilde E., Why is the Web Loosely Coupled?, Proc. of WWW 2009