Google Cloud Platform for Architects
上QQ阅读APP看书,第一时间看更新

Contrasting containers and VMs

You might recall our short introduction of containers, and Kubernetes, at the start of the previous chapter. We had given the example of a simple web application, with a web app upfront and a database out back. We could start with these hosted on VM instances—but then, as the web app got complicated, we'd likely decompose the code into separate services. This move from a monolithic architecture to a service-oriented one, and finally, perhaps even to one based on microservices, is quite typical of the evolution of such app architectures.

The dependencies between these services would quickly get complicated to manage and, to simplify things, we'd probably decompose the services to rest on separate VMs. Then, at this point, we probably would want a continuous integration/continuous delivery (CI/CD) system, where code artifacts are built and deployed on an on-going basis. There would be little point in including the OS image inside each such artifact. That, in a nutshell, gets us to the idea of containers and their differences from VMs. The following diagram shows how containers are different from VMs: