TechTarget.com/searchapparchitecture

https://www.techtarget.com/searchapparchitecture/tip/How-microservices-and-containers-work-apart-and-together

How microservices and containers work, apart and together

By Chris Tozzi

Containers and microservices are related concepts that help companies design and adopt applications with speed, efficiency and flexibility. It's hard to talk about one without also talking about the other. Microservices and containers are distinct technologies -- they don't have to be used together, but they often are. Let's break down how each works, their key similarities and differences, and how an enterprise can use them in tandem.

What are microservices?

Microservices are individual units of software that combine to provide all of the functions required to run an application. Typically, each microservice handles a discrete type of functionality within an application. For example, one microservice handles logins, another generates the UI, another populates the interface with content specific to each user session and yet another interfaces with the database that stores user data.

Until about 2010, most applications were monolithic designs in which the entire application ran as a single unit and, in most cases, as a single process. Prior to wide adoption of the internet and APIs, a service-oriented architecture (SOA) approach evolved to break applications into somewhat smaller pieces. However, the individual services within an SOA are typically not as small or dynamic as microservices.

There are several reasons microservices have become popular over the past decade:

What are containers?

Containers are semi-isolated environments in which applications, or parts of applications, can run. Unlike VMs which run entirely separate OSes, containers directly share resources with the OS of the server that hosts the containers. This makes containers more efficient than VMs because each containerized environment does not require a complete guest OS.

Moreover, containers are isolated at the process level from other containers, as well as noncontainerized processes that run on the server. This isolation makes containers more secure than multiple applications that run directly on a host server. Each container can have different environment parameters, rather than all containers sharing a common configuration.

Technology to deploy applications inside containers has existed since the introduction of the Unix chroot call in the 1970s. Containers became massively popular in the mid-2010s with the introduction of Docker and Kubernetes, which provided tooling that made it easier for developers to create and manage containerized applications.

Microservices vs. containers: Strengths and differences

The main difference between microservices and containers is that microservices are an architectural paradigm, while containers are a means to implement that paradigm. Containers host the individual microservices that form a microservices application.

However, an enterprise can host and deploy microservices in a variety of other ways:

How microservices and containers work together

Nevertheless, containers are the most popular way to implement a microservices architecture, for several reasons:

When to choose containers vs. microservices

Put simply, for an enterprise that wants to deploy microservices, containers offer the best tradeoff among security, performance and management. In some scenarios, it makes more sense to deploy microservices without containers -- for instance, a workload may require especially strict isolation between microservices, or several microservices require different OS environments. VMs might be better suited for these situations. Also, keep in mind that containers can host monolithic applications, not just microservices.

For the foreseeable future, though, expect containers and microservices to fit together in a way that other technologies within the microservices landscape do not.

29 Jul 2021

All Rights Reserved, Copyright 2019 - 2025, TechTarget | Read our Privacy Statement