Skip to content

SOA 2.5

Wim van Gool edited this page Mar 17, 2019 · 16 revisions

<< SOA 2.0: Moving towards Scalable Architectures

Today, the world has fully embraced the event-driven, service-oriented architecture. People use different names for it

  • EDA, SOA, Web-Scale Architecture, MicroService Architecture, Reactive Systems - depending on which characteristic or specific flavour of the architecture they want to highlight, but in essence I now see pretty much any system build as...

  • a set of autonomous, distributed, run-time independent services

  • that are developed, tested and deployed in isolation and

  • that communicate with each other primarily through asynchronous messaging patterns (e.g. a service-bus or message-broker).

Each service represents one slice of the layered cake that's called the IT-landscape, taking on a specific, focussed responsibility. Services can be grouped together in Bounded Contexts and can be assigned a specific service-type. Also, depending on their type, features or specific context they are part of, the platform, frameworks, programming languages and design patterns applied may differ from one service to another.

All things combined, the modern, service-oriented architecture can be depicted as follows:

Event-Driven Architecture Overview

In this view, services as seen as independent, logical units, primarily communicating with each other over a service bus or broker via events, although in some cases they may still use RPC-style communication to send each other commands or query each other for data.

The clients are depicted as a separate layer on top of the services (but not as part of the services themselves), possibly overarching multiple services. In contrast to inter-service communication, clients typically default to synchronous communication by sending commands to services or query them for data, although commands can also be sent asynchronously (fire-and-forget).

Composite UI

A slightly alternate view to this architecture is to have each service contain it's own UI-components, either as standalone clients (scoped only to that service) or as UI parts that can be included in a bigger, separate user interface known as the Composite UI. A benefit of the Composite UI is that the UI parts of each service are automatically updated with each update of the service's back-end, strengthening the relationship between the UI and its server-side parts. In addition, multiple user interfaces can choose to re-use existing UI-parts of different services, thereby increasing the modularity of the whole solution.

The downside of the Composite UI is that its not really straightforward to implement it, given the various different UI-technologies (web, native) and the fact that each Composite UI may want to apply it's own style or UI-template for rendering, demanding that the design of the UI-parts allow this.

MicroServices

One of the most recent developments in SOA are MicroServices. But what are MicroServices? What makes a MicroService different from a regular service in the service landscape? Are they simply smaller versions of the latter, or something different entirely?

The answer is: yes - they are just smaller versions of the same thing. Architecturally speaking, MicroServices are no different from any other service: they are both independent units that have a public contract, some kind of hidden logic and private state, interacting with other services through messaging patterns.

The term MicroService has been introduced to steer towards a design where services become so small that they really only support one specific feature and do this really, really well (such as sending e-mails). By chopping up your service-landscape into tiny little pieces, every service can be focused on a single thing. You also gain the ability to develop, test and update these little pieces independently from one another. It feels like ultimate agility.

But, there is a cost to this, because every service, no matter how fat or tiny, has a specific footprint and overhead in terms of code, maintainance costs, configuration and resources required to host it in production. For example, instead of maintaining a few builds and release pipelines, you now have to manage and maintain many.

Furthermore, fatty services have another advantage: their components are grouped and often compiled and tested together, ensuring they integrate perfectly. When disintegrating services into tiny bits, you gain some flexibility on one end but loose some compile-time safety on the other, and you will have to perform (more costly) service-integrations tests to ensure everything works together.

Whether or not to use MicroServices is a matter of choice that dependends on your specific situation. It's also not an all-or-nothing choice: you can have some fatty services or native applications live together with a few really small, focused services. There is no right or wrong here - just do what fits your situation best.

Containers

Another technology that has been around for a while but has gotten some real traction nowadays is the containerization or sand-boxing of each service so that each service is hosted inside a tiny, lightweight virtual box called a container. The advantage over placing each service in such a container over traditional deployment is that containers...

  • represent an isolated environment for a service, which can therefore be optimized and specifically configured for that service, including the use of an operation system that differs from the hosting environment (the environment the container is deployed to),
  • allow you to configure the external network connections and ports, adding firewall-like security by default,
  • allow you to ship each service as a simple package that can just be plugged into the environment where containers are deployed to.

Docker is currently the most popular platform to package and host services inside containers. Some organizations have already made it company policy to deploy all their services as Docker-containers, and I expect this to be even more common in the future, as the capabilities and ease of use of containers keeps growing.

NuGet

NuGet has been Microsoft's software-component/package distribution platform since 2010, allowing developers to download utility-software for their own development or upload their own. At first, it was primarily used to download and install libraries that were used as an addition or extension to the standard .NET Framework assemblies (which were always downloaded and installed separately), but today Microsoft has been using it more and more as their primary distribution of everything and NuGet has become the standard way of downloading, installing and updating all packages and frameworks you require for your projects.

In addition, developers can host and configure their own NuGet server. This has become a very useful way of sharing common software utilities within a single project or company. It has, in fact, become the natural way to share a service contract along with its version-information and some guidance, replacing the old habbit of uploading these contract-libraries to a specific network-share:

Contract-Sharing via NuGet

The Future of SOA

With the introduction of Service-Oriented Architecture about two decades ago, we made big step towards a landscape of services and applications that integrated much better than before. We also got more grip on data, business logic, security and many other aspects related to IT systems. But the systems didn't scale very well yet.

In the next iteration, asynchronous communication and event-driven services became the norm, and this helped us build truly scalable systems and services that were really run-time independent. In the means time, new architectural patterns emerged or matured, aligning perfectly with the generic notion of service-orientation.

Nowadays, the improvements in technology, available platforms and patterns have made it even easier and more fun to implement event-driven, service-oriented systems.

It's of course impossible to look into the future and see what the next big technology or paradigm shift will be. Nonetheless, I have a hunch that, given the solid basic foundations and principles of the current architecture, we will not see any real revolutionary changes to the basic architectural principles any time soon: I think the world will be focusing primarily on how to design, implement and test their services and surrounding platforms even faster and better than we do today.

The Kingo framework was designed and implemented with that goal in mind. Therefore, I hope it will help you implement and test your (micro)services or faster and better. Before we get to that, let's take a closer look at how you design a MicroService with the framework.

Clone this wiki locally