What is a microservices architecture?

This software development method focuses on flexibility - but how does it work?

Processor architecture

Microservices architecture is a type of application infrastructure that separates the functions of an application into smaller, self-contained parts, which can then be reused for other purposes.

To explain, take this example of an application created to control a device's on and off state with an SMS message. Within traditional application development, every aspect of its function is coded as part of one central codebase.

However, under microservices architecture, the three main functions of the app are instead split into three: one that's designed to receive SMS messages and process them, one created to interpret the content of messages, and one more built to take this interpretation and initiate a command of 'on' or 'off'.

An advantage of microservices architecture means that the individual components are independent of one another, which allows them to be deployed separately. So if need be, you can simply swap out one for another without having to recode the entire application - you can change the app to trigger based on a tweet, rather than a text, for example.

There is no such flexibility with traditional 'monolithic' applications, where a change in function would need an entire app stack to be changed and redeployed. A bit like baking a cake and then trying to change its ingredients after you'd pulled it out the oven.

How do microservices work?

Microservice architectures practically go hand-in-hand with containers; these two technologies are almost always deployed together. Containers are self-contained platforms that host the minimum number of libraries required to carry out their particular functions, much like microservices, and function outside of nearby containers.

Due to their small size, and the fact containers are easily configured, they’re an ideal conduit for microservers. Administrators need an orchestration layer to manage all the containers within their IT environment, however, such as Kubernetes. Kubernetes is widely considered one of the best tools for orchestrating containers, although a variety of options are available.

Although microservices can be established and run independently of the wider software application, communication is still essential between itself and other services so that the application can work as it should. Application programming interfaces (APIs) are the chief route through which this form of communication can be established, as these allow microservices to pass commands between each other as and when required. HTTP and REST (representational state transfer) is normally used for this.

Benefits of microservices

Related Resource

The business value of Red Hat Runtimes

Challenges and opportunities of Red Hat Runtimes

servers with glowing lights Free download

The main benefit is the stability that microservices provide, with components being easy to exchange when they need to be modified or replaced. Even the failure of one microservice not necessarily affect the performance of the wider ecosystem in any wide-reaching manner. While this depends entirely on the function of the the microservice in question, should a non-essential component fail, it should lead to the breakdown of one specific function, rather than the wider application. This structure and process also allows IT teams to identify issues in the 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.

Featured Resources

The ultimate law enforcement agency guide to going mobile

Best practices for implementing a mobile device program

Free download

The business value of Red Hat OpenShift

Platform cost savings, ROI, and the challenges and opportunities of Red Hat OpenShift

Free download

Managing security and risk across the IT supply chain: A practical approach

Best practices for IT supply chain security

Free download

Digital remote monitoring and dispatch services’ impact on edge computing and data centres

Seven trends redefining remote monitoring and field service dispatch service requirements

Free download

Most Popular

Best Linux distros 2021
operating systems

Best Linux distros 2021

11 Oct 2021
Apple MacBook Pro 15in vs Dell XPS 15: Clash of the titans

Apple MacBook Pro 15in vs Dell XPS 15: Clash of the titans

11 Oct 2021
Windows 11 has problems with Oracle VirtualBox
Microsoft Windows

Windows 11 has problems with Oracle VirtualBox

5 Oct 2021