Eclipse Authors: Pat Romanski, Elizabeth White, Liz McMillan, David H Deans, JP Morgenthal

Related Topics: Eclipse, Microservices Expo, IBM Cloud

Eclipse: Article

The Case for Single-Purpose Services

Any service that is created needs to have a cleanly defined responsibility

What a Service Is
There are a surprisingly large number of definitions of the term "service". The discrepancies between these definitions are equally surprising. Defining what a service is in the face of such diversity is not something that I want to even attempt in this article. I do, however, want to make some notable distinctions.

A Web Service Is Not Automatically a Service
There is an unfortunate tendency among practitioners to use Web service as a synonym for service. Web services are currently the most popular choice for implementing services. However, that is not the same thing as claiming that a Web service is automatically a service.

Exposing functionality as a Web service without any consideration of how it will contribute to the whole architecture of services will probably not lead to a "real" service - that is, a real unit of service-oriented logic. Web services that are produced in this manner are more likely to have poor semantic interoperability with other Web services within the same architecture. They can therefore not easily be reused and they cannot communicate effectively with other software programs.

JBOWS is the word of choice to describe an architecture comprised of these poor excuses for services. The acronym comes from the phrase "Just a Bunch of Web Services" [REF-13]. JBOWS is radically different from service-oriented solutions, even though both may be built using Web services technology.

A Service is Not Automatically a Web Service
If a Web service isn't automatically a service, then we might just as well ask ourselves if a service must be implemented as a Web service. There are, in fact, quite a few references to developing services as components and the consequences thereof [REF-14]. Another more recently popular option is the delivery of services as RESTful services. See Figure 7 for a simple comparison.

(Figure 7: The currently three most popular ways of implementing a service)

The Cost of Building Services
When practitioners are asked how expensive it is to build services, they tend to have different opinions. Some of the increased cost comes from buying and maintaining the extra infrastructure that is required. Other costs have to do with educating developers and IT professionals so that they know how to take advantage of this new infrastructure. You may also have to spend both time and money educating business people and developers to help them grasp concepts like service-orientation and service-oriented computing. Teaching developers how to handle schemas, versioning, and new security requirements can take some time. Achieving agreement as to how your business should adopt SOA can take much longer.

Agreeing on things like what kind of information is relevant (how the real world should be abstracted into business entities, for example), how this information should be structured and how it should be used by business processes, also can take quite some time. But this effort is required if you want to be able to build business services with intrinsic interoperability and stable contracts. If you take shortcuts and end up with contracts that are non-standardized and prone to change you will find that subsequent business change will have significant ripple effects throughout your architectures (which can be much more expensive than building services properly to begin with). So, while services are more expensive to deliver initially, they are an investment that pays off and actually results in a dramatically more cost-effective enterprise than one based on traditional monolithic applications.

These considerations apply just as much to single-purpose services, except that these services are often less expensive to build than multi-purpose (reusable) services because they do not need to take reuse considerations into account.

The Performance Issue
A common perception is that the use of a Web Service or a RESTful service will affect performance negatively. It is difficult to argue against this because calling a resource over a network will always be slower than accessing that same resource locally. Additionally, calling a service over the network means that you must serialize and deserialize data. There is no way we can claim that this will be faster than not serializing and deserializing the same data.

If performance is our only concern then we can certainly ensure that all resources are available locally. Unfortunately, this is not an option in most enterprises because it would add a lot of cost and we actually need to share a lot of the resources, like data stores.

To assess the performance consideration in relation to single-purpose services, we first need to agree that performance is not something we can calculate based upon processor power and how much work needs to be carried out. Performance, at least for the sake of this article, is the time it takes for the consumer of the service to get the job done.

Network roundtrip time [REF-15] is the time it takes to transmit something to and get a response back from two points in a network. This measurement doesn't take any of the processing that our applications or services do into account. It is purely about network latency. This latency consists of several parts, two of which are: distance delay (the amount of time it takes for a message to travel along the network) and queue delay (the amount of time a message has to spend in a network buffer).

If network latency is considerably higher between the consumer and the service than it is between services, then the network roundtrip time can be reduced by creating an extra service (see Figure 8 for a thought experiment on this).

(Figure 8: The network roundtrip time might be positively affected by positioning a single-purpose service between the consumer and a number of multi-purpose services if the network latency between the consumer and the services is higher than that between services)

The point is that if the amount of time we save on reduced network latency is greater than the time we spend on the serialization and deserialization a Web Service or a RESTful service, the service can out-perform an application that does the actual orchestration itself. Utilizing asynchronous messaging or Asynchronous Queuing might further mitigate this problem by not locking the consumer runtime resources and thereby making network latency less of an issue.

The Component-First Strategy
If you do not feel that you are ready to create a Web service or RESTful service implementation for your service, then I have a recommendation for you:

Create a service but implement it as a component. This means applying Erl's Dual Protocolspattern. Be sure that you understand that you will consequently be unable to fully apply the pattern Canonical Protocol. This approach can reduce some of the costs associated with creating services. For instance you do not need to put a lot of work into handling multiple concurrent calls or dealing with other issues that can often be challenging to implement when you are limited to just one protocol. You can keep these considerations in mind as future improvements when you design your component, but you do not need to actually implement the service so that it is able to handle these things when it is initially delivered. The service contract will be a proprietary API consisting of methods with parameters and should be modeled to suit the underlying services that it is composing.

One of my favorite patterns, which I could discuss at length, is Canonical Schema and I recommend that you use it in your SOA. It involves establishing standardized, compatible schemas for your service inventory which are positioned as part of the technical service contracts. The aim of this pattern is to avoid having to resort to Data Model Transformation, but there are several other benefits as well. If you have successfully applied Canonical Schema, then creating a relatively stable contract for your single-purpose service will be quite easy.

When you create the API for your component implementation you can pick schemas from your library with the confidence that it will be quite easy to communicate with any services that need to be composed. You could accept XML messages that validate against your schemas as parameters in your component, or you could construct Value Objects [REF-16] that mimic the structure of the schemas.

As the service is implemented as a component, there will be very little extra cost added compared to putting all this code into a non-service-oriented application. Furthermore you have constructed the component in such a way that the transition from component to Web service or RESTful service (Figure 9) requires less work. Obviously you will have to do some extra design and development to realize this. The service might not be reused by a lot of applications, but it could still be used a lot and that means that you have to do some extra work. The good news is that your contract will remain relatively stable and the amount of change that you have to make in your non-service-oriented code is limited.

(Figure 9: Start out by implementing the service as a component and change it into Web Service or a RESTful services when or if that becomes more suitable)

The performance of service-oriented components will be very similar to the performance you would get if you incorporated the service-oriented logic natively into a regular application (which might be worse than that of a Web service or RESTful service as previously explained). If performance is your main concern I recommend investing more in the testing cycle. When you have test data that compares the performance of different implementation options for your particular environment, you will have enough information to make the right choices.

The decision to put logic into a service or not should be based on many different factors. Unless you investigate requirements, usage, and environments you may not make the correct initial decision. Using a strategy that allows you to rethink your choice with relative ease is sometimes the only acceptable way because many of the factors that affect our choices tend to change over time. Creating single-purpose services as components is a recommended way of responding to situations where you need to build services, but you cannot justify the extra investment that Web services or RESTful services demand.

As a final word of advice I would say that if you do decide to implement your single-purpose service as a Web service or a RESTful service it is a good idea to implement it in such a way that you can easily change it into a component if that makes sense in the future.


[REF-1] Erl, Thomas. SOA Design Patterns. Prentice Hall, 2008.
[REF-2] See for instance here.
[REF-3] See Erl, Thomas. Service-Oriented Architecture Concepts, Technology and Design. Prentice Hall, 2006, Appendix B for more categories.
[REF-4] Brown, Paul C. To SOA or Not to SOA: That is the Question here.
[REF-5] The "Enterprise Domain Repository" pattern https://edr.dev.java.net/
[REF-6] Erl, Thomas. SOA Principles of Service Design. Prentice Hall, 2008, p 63.
[REF-7] Interview with Jim Webber: Business people are spaghetti-heads here.
[REF-8] See for instance Pace & Carraro. Head in the Cloud, Feet on the Ground. The Architecture Journal #17.
[REF-9] Whittle & Myric. Enterprise Business Architecture. Auerbach, 2005, p 177.
[REF-10] McComb, Dave. Semantics in Business Systems. Morgan Kauffman, 2003, pp 167 - 172.
[REF-11] Evans, Eric. Domain Driven Design. Addison Wesley, 2004, p 109.
[REF-12] Evans, Eric. Domain Driven Design. Addison Wesley, 2004, p 115, here.
[REF-13] McKendrick, Joe. The Rise of the JBOWS Architecture. [REF-14] See for instance Erl, Thomas. SOA Principles of Service Design. Prentice Hall, 2008, p 176.
[REF-15] All related definitions from Davis, Kevin. Understanding Latency in Network Systems here.
[REF-16] Evans, Eric. Domain Driven Design. Addison Wesley, 2004, pp 97-103.
[REF-17] SOAPatterns.org Community Site

I would like to thank Thomas Rischbeck (IPT) and Joshua Anthony (Objectware) for their valuable comments on this article and Peter Tallungs (Objectware) for sharing his insights into uncovering processes in enterprises.

More Stories By Herbjorn Wilhelmsen

Herbjorn Wilhelmsen is an Architect and Senior Consultant at Objectware in Stockholm, Sweden. His main focus areas include service-oriented architecture, Web services and business architecture. Herbjörn has many years of industry experience working as a developer, development manager, architect and teacher in several fields of operations, such as telecommunications, marketing, payment industry, health care and public services. He is active as an author in the Prentice Hall Service-Oriented Computing Series from Thomas Erl and has contributed design patterns to SOAPatterns.org. He leads the Business-to-IT group in the Swedish chapter of the International Association of Software Architects, which performs a comparative study of a number of business architecture methodologies. Herbjörn holds a Bachelor of Science from Stockholm University.

@ThingsExpo Stories
"There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
"Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
"Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.