Skip to content

SOA 1.0

Wim van Gool edited this page Feb 11, 2019 · 5 revisions

<< Home

This is the start of a 3-part series on how I experienced the evolution of service-oriented architecture in the last 10 to 12 years. It's not really required to read this series to be able to understand and use the Kingo framework, but I've written it to provide a little context and just to share my thoughts on the matter.


When I first started working as a professional software developer in 2008, most companies were slowly migrating and refactoring their old, fat, monolithic applications into smaller components, inspired by the promise of the Service-Oriented Architecture: a system composed entirely of a set of distributed services, talking to each other over a network.

At that time, the IT-landscape of most companies consisted of a plethora of different, standalone applications - most of them purchased, some custom built. The main problem these companies faced was that these applications were isolated units that integrated poorly, had overlapping features and all had their own private copies of data, more often than not resulting in data-inconsistencies and trouble telling what the 'true' source of that data was.

The first step to distributed system architecture

The promise of the Service-Oriented Architecture was that it would deliver systems where integration of features and synchronization of data would be improved and where the problem of overlap in features would be reduced, because each feature could be implemented in a single service that could be re-used anywhere. In addition, by storing all data into one or more databases, abstracted away by a service, consistency and integrity of data would be guaranteed. By marking those databases as the master of that data, other applications could just sync their state with these services to ensure they were up-to-date, and everybody would be happy.

That was also the time at which technologies such as SOAP, WebServices, WSDL and other XML-based integration technologies were popular, and the definition of SOA and its 'service' seemed to align perfectly with these technologies. Consequently, every service was built as a WebService, hosting a specific API through asmx to provide access to its features, such as performing a calculation, sending an e-mail, storing a document or returning a piece of data to show on a screen.

I remember that a part of that promise was kept (as is the case with most new technologies and ideas). By far the biggest improvement compared to the old systems was that every specific set of data was now encapsulated and managed by a single service across the entire domain, which had several big advantages:

  • Instead of having copies of data spread out over many application's databases and Excel-sheets, we now had a single source of truth which companies could rely on.
  • Integration between services and applications became much easier, because each service could expose its features to manipulate and/or retrieve specific pieces of data through its API, also providing the opportunity to add all the appropriate security, logging and performance features in one place.

To let services talk to each other, every service had its own formal contract, defined as a set of messages that were declared with XML Schema's. These schema's were then used to generate the appropriate C# classes and what not, so that serialization and deserialization of these messages was easy and straightforward. The resulting contract-library of a service was automatically uploaded to a shared drive on each build, so that other services could download them and use them.

By sharing copies of a service's contract like this, we basically made circular dependencies between services possible while remaining compile-time independent from one another:

Sharing Service Contracts through a network share

Note that services were seen as purely functional units with a contract and an implementation consisting of logic and data - the parts we have been referring to as the back-end or server-side of a system. User Interfaces, also known as front-ends or clients, were built as separate units on top of the back-end services:

Clients and Services

Service Types

Having gained some experience in building these types of systems, we began to identity different types of services, where each type would indicate what specific role or purpose a service had in the service landscape. The most common types I encountered were the following:

  • Business Services (or Domain Services), which were the foundational services that encapsulated a specific data-set and typically contained some business logic to safely manipulate this data.
  • Process Services, which would coordinate long running processes (which state was kept in a private database), and more often than not would use distributed transactions over several Business Services to ensure atomic changes over an entire subsystem.
  • Platform Services, which would be used for things like security/SSO, message brokers/service bus implementations, etc.
  • Integration Services, which would be used to integrate legacy systems, applications or external services (as a sort of gateway)
  • Business Intelligence Services (or Reporting Services), which would be used to aggregate all business data to create management reports and other kinds of insightful information.

So a typical architectural design of a service landscape looked something like this:

Service Types

Limitations of SOA 1.0

The step towards Service-Orientation was a big, positive development. But the systems were far from perfect yet. Not because the technologies and languages were lacking those awesome features or elegant syntax we have today, but because there was a major flaw in the architectural design of SOA 1.0: we were looking at services like distributed objects that would be mostly talking to each other using Remote Procedure Calls (like one object's method invoking another object's method and must wait for it to return).

This meant that services, although being implemented and tested in isolation, were still highly run-time dependent on each other. If, for example...

  • service A receives a request and
  • needs to make a call to service B to fulfill that request and
  • service B depends on service C for its operation,
  • and so on and so forth,

then the call chain would become very fragile very quickly: any glitch on the network, concurrency issue, timeout or other problem in one of the services would cause the entire call-chain to fail, and the entire operation/transaction would be rolled back.

RPC with Transactions

Moreover, since every service locked onto a bunch of server resources (memory, a thread, perhaps some locks on files or databases) while waiting for the response of the other service, these resources would quickly become depleted on heavy server load. It also greatly increased chances on deadlock scenarios (again, with timeouts and errors as a result).

Note that this was also before the Task Parallel Library and async/await had been introduced, so most waits were blocking, with the possibility of running out of threadpool threads in busy times.

This problem was only magnified by using distributed transactions, which became long-running, resource intensive operations and above-all risky, because network failures could and would cause transactions to remain in doubt, and let some developer manually investigate and fix the issue in production.

In short, we did make a big step towards building elegant, distributed systems, but the current architecture just wasn't good enough (i.e. scalable) yet. And so, after some time, we invented a better architecture.

SOA 2.0: Moving towards Scalable Architectures >>

Clone this wiki locally