Thought Leadership for the Global C-Suite

The VITO Report

Subscribe to The VITO Report : eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get The VITO Report : homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

VITO Report Authors: Elizabeth White, Liz McMillan, Roger Strukhoff, Timothy Fisher, Ernest de Leon

Related Topics: Java EE Journal, SOA Best Practices Digest, SOA & WOA Magazine, VITO Report


Learning from SOA Mistakes

A guide to SOA anti-patterns - how to benefit from known unworkable solutions

Today, global businesses are increasingly turning to Service Oriented Architecture (SOA) for their information technology infrastructure and applications. SOA is becoming an increasingly practiced approach to building software solutions as it can support integration and consolidation of activities in complex enterprise systems.

This year the percentage of functioning SOAs has almost doubled, according to Evans Data Corporation's latest Web Services development survey: "Twenty-four percent of respondents (the sample data set being 400) are saying they currently implement SOA, an 85% increase from last year." The survey also shows that Web Services are now experiencing more comprehensive implementation, with 30% of respondents predicting they will be using more than 20 services in the next year - a 58% increase from current levels. Twenty-five percent of respondents also said the leading problem in implementing Web Services are changing or lack of industry standards, a 67% increase from last year. A July 2006 article in SDA Asia Magazine reported that "The awareness of service-oriented architecture benefit as an IT enabler is now extensive. There is a growing and widespread acceptance of SOA technology, especially in large enterprises." And according to a recent Aberdeen Group survey, at least 90% of companies are on their way to adopting SOA today."

Despite these reports, SOA is still a relatively new approach, which many businesses are deploying for the first time. How can they avoid the pitfalls that are inherent in treading on any new technology path? One answer is to share the experience of the IT community. In the few years of SOA adoption, a number of best and worst practices have already emerged, and these lessons learned map not to just application (code) development but also to other phases of SOA solution construction.

What Is SOA?
The Open Group defines SOA as an architectural style that supports service orientation, a way of thinking in terms of services, service-based development, and the outcomes of services where a service:

  • Is a logical representation of a repeatable business activity that has a specified outcome (e.g., check customer credit, provide weather data, or consolidate drilling reports);
  • Is self-contained;
  • May be composed of other services; and
  • Is a "black box" to consumers of the service.

    An architectural style is the combination of distinctive features in which architecture is performed or expressed. The SOA architecture has the following distinctive features:

  • It's based on the design of the services - which mirror real-world business activities comprising the enterprise (or inter-enterprise) business processes.
  • Service representation uses business descriptions to provide context (i.e., business process, goal, rule, policy, service interface, and service component) and implements services using service orchestration.
  • It places unique requirements on the infrastructure - it's recommended that implementations use open standards to realize interoperability and location transparency.
  • Implementations are environment-specific - they're constrained or enabled by context and must be described in that context.
  • It requires strong governance of service representation and implementation.
  • It requires a "litmus test" that determines a "good service."

    SOA projects are complex in that they span layers from business goals and processes down to low-level technical implementation details as described in the excellent paper by Ali Asranjani and illustrated in Figure 1. Successful SOA implementation is hard. The key points to remember are:

  • Build an internal agreement for using a SOA as an approach for an initial project
  • Start with something useful but manageable
  • Business and IT need to agree on an area of focus
  • Plan for governance and skills development
  • Plan to deliver success early and control costs
A useful approach is to have an initial exercise to scope the work and the first project followed by, concurrently, i) governance development, ii) competency development, and iii) an initial manageable project. However, even when this approach is adopted, there can be problems. Many groups in an organization are involved in building the solution for a SOA project. In addition, because SOA is so new, it's almost guaranteed to involve technologies and techniques that organizations have inadequate experience of. This combination solution involves much of an organization and the requirement to take on many new technologies and methodologies causes several opportunities for trouble, many of which are known and can be avoided with good planning.

Patterns and Anti-Patterns
Architects know how to use patterns that represent known workable solutions to given problems to develop the solution architecture. But SOA projects can also benefit from anti-patterns, or known unworkable solutions. Anti-patterns are the design choices to avoid and, while people can often learn more from failures than successes, they are less frequently discussed. In fact, knowing about anti-patterns can be useful across many project roles, including project managers, analysts, and developers as well as architects.

A pattern is a known-to-work solution to some problem. An excellent analysis by Jonathan Adams and others identifies several levels of patterns:

  • Business patterns that identify the interaction between users, businesses, and data.
  • Integration patterns that tie multiple business patterns together when a solution can't be provided based on a single business pattern.
  • Composite patterns that represent commonly occurring combinations of business and integration patterns.
  • Application patterns that provide a conceptual layout describing how the application components and data in a business pattern or integration pattern interact.
  • Runtime patterns that define the logical middleware structure supporting an application pattern. Runtime patterns depict the major middleware nodes, their roles, and the interfaces between these nodes.
  • Product mappings that identify proven and tested software implementations for each runtime pattern.
  • Best-practice guidelines for design, development, deployment, and management of e-business applications.
A pattern specification typically includes the name of the pattern, the problem solved by the pattern and forces that apply, a description of how the pattern works, a diagram (e.g., a sequence diagram) that illustrates the pattern, an implementation section (e.g., a UML model) and, finally, examples of how the pattern can be used.

An anti-pattern is an attractive apparent solution to a problem that is known not to work. The term was originally used to refer to a design pattern gone wrong. More precisely, an anti-pattern specification describes a poor solution to a problem, explains why this solution looks attractive and why it turns out to be bad, and offers better solution(s) to the same problem.

Anti-pattern descriptions provide a common vocabulary and an awareness of pitfall situations. They identify the symptoms, consequences, root causes, and potential replacement solutions for anti-patterns. An operational definition of an anti-pattern involves specifying the problem, the symptoms, the root-cause(s) of the problem, the consequences of building a solution using the anti-pattern, and a solution that presents a remedy to using the exposed anti-pattern.

Example Anti-Patterns for SOA
To illustrate the concept, let's look at a few SOA anti-patterns in detail equating SOA with Web Services, chatty services, and point-to-point services.

Example SOA Anti-Pattern: Equating SOA with Web Services
A common mistake made by architects of SOA solutions is to equate a SOA solution to one that simply has Web Services. If the Web Services aren't aligned with the business reason why a SOA solution was desirable in the first place, the solution isn't service-oriented. The following is a description of the anti-pattern using the terminology described above:

  • Problem: Equating SOA with Web Services
  • Symptoms: Symptoms of this anti-pattern include replacing existing APIs with Web Services without proper architecture and when services aren't business-aligned.
  • Consequences: The consequence of adopting this bad practice is the eventual proliferation of Web Services. It's also likely that those existing systems won't have interfaces that reflect the requirements of the service requestors. When services aren't aligned with business processes, the resulting solution greatly reduces the opportunities for reuse, for example, in composing new processes using existing services.
  • Root Cause: The main cause of this anti-pattern is haste, i.e., an architect assuming "I can take shortcuts and do this SOA stuff quickly and cheaply." This also results from ignorance in the area of transforming an IT architecture to a Service Oriented Architecture that's driven by business needs.
  • Solution: The solution is to apply proper service modeling techniques such as IBM's Service-Oriented Modeling and Architecture (SOMA) methodology, which will help in effectively mapping the business processes to SOA by identifying and specifying services. This approach (shown in Figure 2) facilitates the development of a viable transition plan from the current architecture to a Service Oriented Architecture with a defined SOA value proposition. Education on the difference between a Service Oriented Architecture and Web Services is also important. Most of today's production Web Service systems aren't based on Service Oriented Architectures - they're based on simple remote procedure calls, or point-to-point messaging via SOAP, or well-structured integration architectures. Most of today's Service Oriented Architectures not only use Web Services - they also use mature technologies such as FTP and batch files. Asynchronous messaging and Web Services technology are principally used in newer systems being integrated into a SOA. Hence, Web Services can be only part of the answer.
Example SOA Anti-Pattern: Chatty Services
Another commonly seen anti-pattern is to realize a business service by implementing a number of Web Services where each Web Service exchanges a tiny piece of data with the others. We refer to such services as chatty services. Figure 3 shows an example of chatty services between the presentation and business layers of the SOA architecture. The following is a description of this anti-pattern:
  • Problem: Realize a service by implementing a number of Web Services where each communicates a tiny piece of data.
  • Symptoms: The symptom of this bad practice is that the implementation will eventually have a large number of services.
  • Consequences: Chatty services result in degradation in performance and costly development. This anti-pattern also burdens the consumer with the task of aggregating these services to realize any benefit.
  • Root Cause: The root causes of such an implementation are mimicking an API implementation, and being so excited by the service concept that everything becomes a BPEL-defined business service, with no benefit and excessive cost. Chatty services can also be a consequence of too rigid service interfaces. This typically happens when client/server technology is simply being replaced by services with rigid interfaces in the process of transformation to a Service Oriented Architecture. Such a naïve transformation to SOA typically introduces operations that haven't been modeled with variability, resulting in a multiplication of operations and hence chatty services
  • Solution: The most effective solution is to refactor the design to combine individual pieces of data into one document. It's important not to use fine-grained calls. For example, to get the employee data that includes the employee's first name, last name, and office phone number, it would be a bad practice (that results in chatty services) to invoke a Web Service for each of these three elements. A better solution is to encapsulate the first name, last name, and office number in a single document and invoke a single Web Service to retrieve the employee data.
Here again, education on the difference between API and service and on the granularity of services is important. A recommendation to identify the exposed services is to apply litmus tests on the candidate services. A litmus test for a service is one that will answer all of the following questions:
  • Does the service provide a required unit of business functionality that supports business processes and goals?
  • Does the service promote composability with other services?
  • Can the service description be externalized?
  • Does the existence of the service help in eliminating redundant implementations, i.e., promote reuse?
  • Does the candidate service have a long enough lifecycle to be considered useful?
Example SOA Anti-Pattern: Point-to-Point Services
Implementing point-to-point services is an alternative to having a middleware layer that will route the service calls to service implementations. In such an approach, each requestor must individually access the corresponding service provider. Such practice is an anti-pattern and the following description of the anti-pattern explains why:
  • Problem: Replacing middleware with point-to-point Web Services as an integration approach.
  • Symptoms: Using XML or SOAP over HTTP between applications to effect communication between applications.
  • Consequences: Point-to-point integration emerges as the de facto integration pattern. This pattern promotes an integration complexity of the order of N*(N-1), where N is the number of services, resulting in error-prone management of the architecture.
  • Root Cause: The root cause for this anti-pattern is usually a view that an integration layer, usually called an Enterprise Service Bus (ESB), adds:
    - Complicated new technology
    - A single point of failure
    - Cost (for the ESB software and supporting hardware)
In fact, an ESB can be a key component, which enables much greater flexibility and reduces the complexity of the solution by providing a common point for interconnection to services. ESB technology has also proven to be robust and scaleable.
  • Solution: The solution that scales and results in more manageability (with order N complexity) is to use an intelligent connector such as an Enterprise Service Bus (Figure 4). An ESB enables applications to work together simply and efficiently to support business needs. Point-to-point integration results in tight coupling where each application has to be aware of the details of all other applications with which it can potentially collaborate. In the Enterprise Service Bus case, on the other hand, the coupling is loose and simpler. The bus also allows an application to be unaware of the details of the other applications that it collaborates with.
Solution Levels
The examples described all relate to architecture/design but, as experience with SOA accumulates, anti-patterns are beginning to emerge at all levels of the SOA solution process. The following table shows an example at each level.

SOA solution levelExample(s)
Project Management & MethodologyNot planning incremental build cycles
ModelingNot formally modeling business processes
Architecture/DesignNot understanding the full scope of included systems/interfaces in the solution

Security can be added later after system design

Assembly/DevelopmentFalling into the build-from-scratch rather than reuse existing services trap
Performance ManagementFailing to start verifying performance early in the project
Testing/QAFailure to test business process requirements
DeploymentNot planning for incremental and continuous deployments
System ManagementNot allowing for SLA management at the process level
Problem determinationNot planning for problem determination across a process

Example SOA Anti-Pattern: No Incremental Builds of the SOA Solution
This SOA anti-pattern is an example of a bad practice that can be exercised by a project manager:

  • Problem: Assembling the complete solution, only late in the lifecycle.
  • Symptoms: Each sub-team works independently but the whole end-to-end solution is only tested in a system integration test at the end of the development.
  • Consequences: Point-to-point integration emerges as the de facto integration pattern. This pattern promotes an integration complexity of the order of N*(N-1), where N is the number of services, resulting in error-prone management of the architecture.
  • Root Cause: Problem determination and problem isolation are left until the system integration test stage, when they are very hard to do. Performance problems in individual sub-teams' efforts and in end-to-end integration aren't seen and resolved early.
  • Solution: Build the solution in stages:
    - Build 0: Install the vendor-supplied software, e.g., middleware, and validate that all components install successfully. This will confirm that the required products have all been assembled and should also verify that patch level, operating system; disk space, and memory requirements have been met.
    - Build 1: Create a few simple end-end services. There should be no more than one or two, and it's important that they are truly end-to-end. An example might be to look up a customer, assuming that the customer database is part of the solution. This can be done from a portlet in the solution portal. It should exercise the portal, the ESB, the back-end database, and the services it exposes. Ideally, this would also exercise the security subsystem, at least to the extent of validating a single initial user. This step will prove that all the solution components can work together or will highlight problems among them at an early stage in the project.
    - Build 2...Build n: Build more solution elements, releasing them to testing in meaningful increments. A key part of a SOA is that it supports being able to assemble services into processes. This capability must be exercised early in the project to confirm that services are indeed composable into the required processes.

More Stories By Tony Carrato

Tony Carrato is the worldwide chief operations architect for the SOA Advanced Technology team in IBM's Software Group, focusing on SOA delivery. In this role, he is responsible for a team of IT architects who help IBM clients define and implement SOA projects around the world. Tony has over 30 years of IT experience, concentrating in financial services and telecommunications. He has held a variety of senior technical positions in Australia, Hong Kong, and the U.S.

More Stories By Harini Srinivasan

Dr. Harini Srinivasan is on the SOA design requirements team at IBM Software Group – a team that works with customers and IBM architects to capture SOA specific requirements and articulate them to relevant IBM SOA technology groups including the SOA product divisions. Before joining the SOA design requirements team, she spent 10 years at IBM Research as a Research Staff Member and has worked on customer-focused research topics such as performance analysis tools, JVM runtimes (including instrumentation) and C++ object models. . Her background is program analysis (static and dynamic analysis for performance and debugging), parallel and distributed systems including compiling explicitly parallel programs and runtimes for Java and C++.

More Stories By Chris Harding

Dr. Chris Harding leads the SOA Working Group at The Open Group - an open forum of customers and suppliers of IT products and services. In addition, he is a director of the UDEF Forum and manages The Open Group?s work on semantic interoperability. He has been with The Open Group for over 10 years. Dr. Harding began his career in communications software research and development. He then spent nine years as a consultant, specializing in voice and data communications, before moving to his current role. Recognizing the importance of giving enterprises quality information at the point of use, he sees information interoperability as the next major challenge, and frequently speaks or writes on this topic. Dr. Harding has a PhD in mathematical logic, and is a member of the British Computer Society (BCS) and of the Institute of Electrical and Electronics Engineers (IEEE).

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.