12.07.2019 Views

NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

like Sublime, Emacs, vi, and the open-source OmniSharp project, which also provides IntelliSense<br />

support.<br />

In addition to the IDEs and editors, you can use the .<strong>NET</strong> Core CLI tools <strong>for</strong> all supported plat<strong>for</strong>ms.<br />

Using containers <strong>for</strong> new (“green-field”) projects<br />

Containers are commonly used in conjunction with a microservices architecture, although they can<br />

also be used to containerize web apps or services that follow any architectural pattern. You can use<br />

.<strong>NET</strong> Framework on Windows Containers, but the modularity and lightweight nature of .<strong>NET</strong> Core<br />

makes it perfect <strong>for</strong> containers and microservices architectures. When you create and deploy a<br />

container, its image is far smaller with .<strong>NET</strong> Core than with .<strong>NET</strong> Framework.<br />

Creating and deploying microservices on containers<br />

You could use the traditional .<strong>NET</strong> Framework <strong>for</strong> building microservices-based applications (without<br />

containers) by using plain processes. That way, because the .<strong>NET</strong> Framework is already installed and<br />

shared across processes, processes are light and fast to start. However, if you are using containers, the<br />

image <strong>for</strong> the traditional .<strong>NET</strong> Framework is also based on Windows Server Core and that makes it too<br />

heavy <strong>for</strong> a microservices-on-containers approach.<br />

In contrast, .<strong>NET</strong> Core is the best candidate if you are embracing a microservices-oriented system that<br />

is based on containers, because .<strong>NET</strong> Core is lightweight. In addition, its related container images,<br />

either the Linux image or the Windows Nano image, are lean and small making containers light and<br />

fast to start.<br />

A microservice is meant to be as small as possible: to be light when spinning up, to have a small<br />

footprint, to have a small Bounded Context (check DDD, Domain-Driven Design), to represent a small<br />

area of concerns, and to be able to start and stop fast. For those requirements, you will want to use<br />

small and fast-to-instantiate container images like the .<strong>NET</strong> Core container image.<br />

A microservices architecture also allows you to mix technologies across a service boundary. This<br />

enables a gradual migration to .<strong>NET</strong> Core <strong>for</strong> new microservices that work in conjunction with other<br />

microservices or with services developed with Node.js, Python, Java, GoLang, or other technologies.<br />

Deploying high density in scalable systems<br />

When your container-based system needs the best possible density, granularity, and per<strong>for</strong>mance,<br />

.<strong>NET</strong> Core and ASP.<strong>NET</strong> Core are your best options. ASP.<strong>NET</strong> Core is up to ten times faster than<br />

ASP.<strong>NET</strong> in the traditional .<strong>NET</strong> Framework, and it leads other popular industry technologies <strong>for</strong><br />

microservices, such as Java servlets, Go, and Node.js.<br />

This is especially relevant <strong>for</strong> microservices architectures, where you could have hundreds of<br />

microservices (containers) running. With ASP.<strong>NET</strong> Core images (based on the .<strong>NET</strong> Core runtime) on<br />

Linux or Windows Nano, you can run your system with a much lower number of servers or VMs,<br />

ultimately saving costs in infrastructure and hosting.<br />

12 Choosing Between .<strong>NET</strong> Core and .<strong>NET</strong> Framework <strong>for</strong> Docker Containers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!