Microservices as an Ecosystem

Getting the big picture right

Zooming out

Often when people think of microservices, the entire philosophy is reduced to the idea of breaking the big evil monolithic application into tiny mini-apps of software goodness.

Although that is an important part of the vision, it can easily lead developers and architects down the wrong path.

Arguably, microservices might have more to do with the ecosystem in which software lives, than with the actual software itself.

Software as a space ship

In the good old days, things were simpler. Software used to be a single executable installed on one or maybe a limited number of servers.

The amount of 3rd party services that an application had to interact with was also quite limited. Unfortunately, that required a huge investment in terms of developing these services in house. Examples may be authentication, user management, database services, payment, etc.

The benefit of these simpler times was that it was quite possible to develop, manage, and maintain a single, but large application as one unit.

Image for post
Image for post

Imagine a spaceship: It contains and manages both the environment that keeps the astronauts alive, as well as the actual hardware to accomplish its mission. Old software worked like this.

But here lies all the limitations. Compared to life on earth the ecosystem is painfully poor. It is very difficult or even impossible to expand that ecosystem and making changes to any part of the spaceship effects everything else.

Why an ecosystem?

Anyone who has ever raised a fish is intimately aware of how intertwined a biological creature is with its environment. In order for any creature to thrive the environment needs to be ideal.

Image for post
Image for post

The world of software has become a very rich ecosystem. We have endless options to host software in the cloud, whether as containers, in Kubernetes, as serverless lambdas, the sky seems to be limitless. We also have a near-limitless offering of 3rd party services, from payment gateways to globally scaled databases to machine learning. And around all of this is an even richer environment of build automation, monitoring, analytics, code, and team management tools.

Any modern company that seeks to be an effective business must successfully and effectively integrate and manage this complex ocean of technologies. To add to the complexity, no two businesses will end up with the same ecosystem: each ecosystem is unique and custom.

A microservice ecosystem

In essence, the microservice movement recognizes this shift from viewing the environment of software as a spaceship to that of an open ecosystem. In some ways, it is an inversion of the focus.

And this is where it is a mistake to think that adopting microservices is simply the task of breaking a large application into smaller micro applications. It would be synonymous with the idea of taking the international space station and simply disconnecting each module from one another. That would simply render each module unusable and destroy the overall function of the space station.

Thus, although modularization is an important part of the microservices vision, it requires that an effective ecosystem exists to provide a context for each unit to thrive in. It also means that each software unit must also contain a number of essential elements required for life. Each microservice must be able to function somewhat independently in this ecosystem.

The need for a microservice toolkit

Providing these essential elements to each microservices is one of the major stumbling blocks in adopting microservices. Each microservice must be built, tested, configured, integrated into the CI/CD pipeline, deployed, monitored, and updated. It must also interact with other microservices. This requires discovery and well-managed communications interfaces. Logging across a distributed environment also requires injecting correlations ids and traces into all communications.

Often companies will develop a common library used by all microservices to add these cross-cutting features. However, implementing and maintaining such a library for multiple programming languages can exact a huge toll on a business.

Another problem with self-rolling a base library is self-generated vendor lock-in. It is normally easier to develop an infrastructure library for a specific environment or technology. For instance, implementing an authentication service that works in both AWS and Azure requires more effort compared to supporting only one provider. This can lead to a microservice library that becomes increasingly locked into a single vendor and makes it harder for a business to evolve and potentially capitalize on new and emerging offerings.

The need for a polyglot microservice toolkit

Although a number of good microservice frameworks exist for specific languages, such as spring for java, multi-language offerings have been lacking.

Enter pip-services: https://www.pipservices.org/

pip-services introduces itself as:

pip-service supports .Net, Java, Node.js, Python, Dart, and Golang. One of its strengths is the commitment to providing a “symmetric” implementation in each language. That means the design pattern, API footprint, directory structure, build scripts and every aspect of the toolkit look exactly the same in each language. This enables developers to easily switch between microservices written in different languages and immediately feel properly oriented.

pip-services is also vendor-agnostic and makes it easy to host the microservices anywhere, whether it is as a windows service on-premise, or as a docker container in Kubernetes on AWS or Azure, or an application in Service Fabric.

pip-services also provide an extensive catalog of pre-built open source microservices covering a wide range of capabilities:

No man is an island

The world of microservices is still very much evolving. Empowering small and medium-sized organizations to effectively embrace and utilize microservices remains a challenge.

Proper patterns, policies, best practices, and training are essential for any business to thrive in the microservice ecosystem. pip-services is a great launchpad to help businesses avoid common mistakes and have a successful future with microservices.

Written by

Microservices & DevOps Software Engineer and Consultant

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store