Today, microservices are increasingly becoming a dominant architecture form. In short, it is an approach to application development where software is built from small and independent services that communicate over well-defined APIs. This article provides a brief overview of microservices and how they can be deployed.
A modular architecture approach based on microservices aims at dismantling an application into small, independently deployable pieces of software that communicate over well-defined APIs. There are multiple advantages of using a microservices architecture, which include that they can be individually managed and therefore also individually programmed, scaled, reused, analyzed, or replaced – with less or no impact on the overall system.
What is a Microservice?
Although there is no common definition for what a microservice is, we can agree on a common set of characteristics: They are small, individual, and independent components of the software that, together, make an application. They are business-oriented, which means that the software architecture focuses on business purposes, such as a business capability, a particular product, or service. Every microservice provides a small piece of software for a greater purpose. Therefore, microservices regularly communicate with each other when in operation. A major purpose of microservices is that they can be developed and deployed independently from each other. This leads to a decentralization of development teams in practice, which enables them to develop and deploy faster and with fewer dependencies and constraints. Due to the modular architecture and the increased amount of communication interfaces between the microservices, errors and failures can be analyzed more precisely. In addition, microservice architectures are usually designed in such a way that they still function in the case that single microservices provide errors. A microservices architecture is often used in areas that are continuously developed further. In such environments, the advantages of independent development and deployment, as well as failure tolerance are of the highest importance.
How do Microservices Communicate?
From an Architecture perspective, Microservices have two components: the application functionality itself that provides a business service, and a set of standardized interfaces that allows the microservice to communicate with other microservices or databases. For the microservices interfaces to work, a service-oriented architecture approach that manages standards and compatibility of the communication must be in place and well managed. Only this allows us to view microservices as independent from each other, while their interfaces must meet the defined requirements to communicate with the outer world.
Deployment of Microservices in a Virtual Machine (VM)
Microservices are an architectural style that describes how business functionalities are architected. The technology to implement this kind of style is either a virtual machine (VM) or increasingly a container. What is the difference?
A VM provides a virtual environment on which an operating system can be installed that differs from the operating system that is installed on the physical hardware. This is possible because the operating system in the VM accesses the physical hardware resources via a hypervisor that manages the access and availability. Thus, for instance, a VM can provide Windows on your Macbook. On this virtual operating system, you can then run microservices. It is important to note that every new VM has its virtualization of an operating system.
Deployment of Microservices in a Container
A container, in contrast, does not need a virtualized operating system, but can directly connect to the kernel of the physically installed operating system (which would be the Mac OS in our example above). Every container, containing a microservice each, would access the same operating system and only virtualize services that it needs on top. The result is much more lightweight, faster, but also less secure and less isolated microservice compared to the VM approach. The most known solution for containers is docker.