What is a microservices architecture?
This software development method focuses on flexibility - but how does it work?
Microservices architecture is a form of application infrastructure that splits an app’s functions into distinct, self-contained components, which are then combined to achieve the desired outcome.
To best explain this approach, let’s take an example of an application designed to control a device’s on and off state using an SMS message. In traditional application development, every aspect of the app’s functions would be coded as part of a single codebase.
Under a microservices architecture, the three main functions of the app would be split into three separate microservices: one that’s designed to receive SMS messages and process them, one designed to interpret the content of messages, and another designed to take this interpretation and initiate a command of on or off.
The advantage of microservices architecture is that the individual components are independent of each other, meaning they can be deployed separately. They can also be swapped out for another if needed without having to recode the application. For example, if you decide you would like the app to trigger based on a tweet rather than a text.
This flexibility is typically not possible with traditional monolithic applications, where a change in function would require the entire app stack to be modified and redeployed – like baking a cake and trying to change an ingredient once it’s finished.
How do microservices work?
Microservices architectures are almost universally deployed in conjunction with containers. Much like microservices themselves, containers are small, self-contained packages that hold the minimum amount of libraries needed to execute their particular function, operating independently of the other containers around it.
Because they're built to be small, easily modifiable and self-contained, containers are the perfect way to host microservices, but you'll need an orchestration layer to manage all of the containers within your environment. Kubernetes has established itself as the tool of choice within most organisations, but a multitude of options are available.
While microservices exist and run independently of the rest of an application, they still need to communicate with other services within the application in order for the application to carry out its intended function. This is achieved by APIs, which allow different microservices to communicate and pass instructions between each other. HTTP and REST are commonly used for this task.
Benefits of microservices
We've already highlighted some of the advantages of microservices architectures, but there are a number of reasons why they've become so popular. Stability is a key one; not only are components easy to swap out when they need to be modified or replaced, but the failure of one microservice may not even have a noticeable impact on the application's performance. This will depend on the function being performed by the microservice, of course, but the failure of a non-essential component in a microservices architecture will often break a specific function, rather than the application as a whole. This also makes it easy to identify issues in the processing chain.
Adopting this kind of architecture can also have benefits for the speed of development, too. Because functions within a microservices architecture are not interdependent, different teams with an IT organisation can be working on different microservices within the application at the same time. This means bug fixes and new features can be added faster, which is one of the reasons why DevOps and microservices often go hand in hand.
Containers are re-usable, too. If you have two applications that require the same function to be performed, you can create one microservice to do it and copy it across both applications. Another benefit is the fact that, because they're self-contained, microservices can be coded in any programming language.
The case for a marketing content hub
Transform your digital marketing to deliver customer expectationsDownload now
Fast, flexible and compliant e-signatures for global businesses
Be at the forefront of digital transformation with electronic signaturesDownload now
Why CEOS should care about the move to SAP S/4HANA
And how they can accelerate business valueDownload now
IT faces new security challenges in the wake of COVID-19
Beat the crisis by learning how to secure your networkDownload now