31.03.2020 Views

NET-Microservices-Architecture-for-Containerized-NET-Applications

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

For example, in a typical e-commerce application, you likely need to scale the product information

subsystem, because many more customers browse products than purchase them. More customers use

their basket than use the payment pipeline. Fewer customers add comments or view their purchase

history. And you might have only a handful of employees that need to manage the content and

marketing campaigns. If you scale the monolithic design, all the code for these different tasks is

deployed multiple times and scaled at the same grade.

There are multiple ways to scale an application-horizontal duplication, splitting different areas of the

application, and partitioning similar business concepts or data. But, in addition to the problem of

scaling all components, changes to a single component require complete retesting of the entire

application, and a complete redeployment of all the instances.

However, the monolithic approach is common, because the development of the application is initially

easier than for microservices approaches. Thus, many organizations develop using this architectural

approach. While some organizations have had good enough results, others are hitting limits. Many

organizations designed their applications using this model because tools and infrastructure made it

too difficult to build service-oriented architectures (SOA) years ago, and they did not see the needuntil

the application grew.

From an infrastructure perspective, each server can run many applications within the same host and

have an acceptable ratio of efficiency in resources usage, as shown in Figure 4-2.

Figure 4-2. Monolithic approach: Host running multiple apps, each app running as a container

Monolithic applications in Microsoft Azure can be deployed using dedicated VMs for each instance.

Additionally, using Azure virtual machine scale sets, you can easily scale the VMs. Azure App Service

can also run monolithic applications and easily scale instances without requiring you to manage the

VMs. Since 2016, Azure App Services can run single instances of Docker containers as well, simplifying

deployment.

As a QA environment or a limited production environment, you can deploy multiple Docker host VMs

and balance them using the Azure balancer, as shown in Figure 4-3. This lets you manage scaling with

a coarse-grain approach, because the whole application lives within a single container.

22 CHAPTER 4 | Architecting container and microservice-based applications

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

Saved successfully!

Ooh no, something went wrong!