Deploying Microservices

In the case of monolithic applications, deployments are often made using Xcopy. In Xcopy, all the required files and folders are deployed (moved/ pasted) onto the server. The word Xcopy comes from the Xcopy command of the Microsoft Disk Operating System (MS-DOS). Microservice deployments present a different set of challenges. Continuous integration and continuous deployment(CI/CD) are key practices when delivering microservice applications. Container and tool-chain technologies promise greater isolation boundaries and are essential for microservice deployment and scaling.

What are containers?

A container is a piece of software in a complete file-system. It contains everything that is needed to run code, the runtime, system tools, and system libraries—anything that can be installed on a server. This guarantees that the software will always run in the same way, regardless of its environment. Containers share their host operating system and kernel with other containers on the same host. The technology around containers isn’t new; it has been a part of the Linux ecosystem for a long time.

Do not confuse yourself with containers and virtual machines. At the surface level, both are tools that can be used to achieve isolation and virtualization but, there is architectural difference between virtual machines and containers. The following diagram depicts that:

In virtual machines, there is a host operating system, along with a kernel and a hypervisor layer. Hosted applications have to bring in their own operating system and environment. However, in containers, the containerization technology (Docker engine) layer serves as a single layer, and it is shared across different applications.

Containers are our new binaries

When we compile the .NET program Visual Studio produces .NET assemblies (DLLs or EXEs). In the monolith world, we would take this set of associated DLLs and EXEs and we deploy them on the servers. With microservices, we do not do that anymore.

In the microservices world, we still generate  EXEs and DLLs, but our deployment unit is now different. The assemblies will be pushed to the container and ensured that they’re ready to be shipped. The advantage of container deployment is that it removes the barrier between operating systems and even languages and runtimes.

You might be interested in the following courses:

Course Category

Back to: Microservices with C#, .NET Core and Azure > Deployment