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.

Figure 4-3. Example of multiple hosts scaling up a single container application<br />

Deployment to the various hosts can be managed with traditional deployment techniques. Docker<br />

hosts can be managed with commands like docker run or docker-compose per<strong>for</strong>med manually, or<br />

through automation such as continuous delivery (CD) pipelines.<br />

Deploying a monolithic application as a container<br />

There are benefits to using containers to manage monolithic application deployments. Scaling<br />

container instances is far faster and easier than deploying additional VMs. Even if you use VM Scale<br />

Sets, VMs take time to start. When deployed as traditional application instances instead of containers,<br />

the configuration of the application is managed as part of the VM, which is not ideal.<br />

Deploying updates as Docker images is far faster and network efficient. Docker images typically start<br />

in seconds, which speeds rollouts. Tearing down a Docker image instance is as easy as issuing a<br />

docker stop command, and typically completes in less than a second.<br />

Because containers are immutable by design, you never need to worry about corrupted VMs. In<br />

contrast, update scripts <strong>for</strong> a VM might <strong>for</strong>get to account <strong>for</strong> some specific configuration or file left on<br />

disk.<br />

While monolithic applications can benefit from Docker, we are touching only on the benefits.<br />

Additional benefits of managing containers come from deploying with container orchestrators, which<br />

manage the various instances and lifecycle of each container instance. Breaking up the monolithic<br />

application into subsystems that can be scaled, developed, and deployed individually is your entry<br />

point into the realm of microservices.<br />

Publishing a single-container-based application to Azure App Service<br />

Whether you want to get validation of a container deployed to Azure or when an application is simply<br />

a single-container application, Azure App Service provides a great way to provide scalable singlecontainer-based<br />

services. Using Azure App Service is simple. It provides great integration with Git to<br />

make it easy to take your code, build it in Visual Studio, and deploy it directly to Azure.<br />

22 Architecting Container- and Microservice-Based <strong>Applications</strong>

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

Saved successfully!

Ooh no, something went wrong!