Microservices and containers
There is no direct relationship between microservices and containers. Microservices can run without containers and containers can run monolithic applications. However, there is a sweet spot between microservices and containers.
Containers are good for monolithic applications; however, the complexities and the size of the monolith application may kill some of the benefits of containers. For example, spinning new containers quickly may not be easy with monolithic applications. In addition to that, monolithic applications generally have local environment dependencies, such as local disk, stove pipe dependencies with other systems, and more. Such applications are difficult to manage with container technologies. This is where microservices go hand in hand with containers.
The following diagram shows three polyglot microservices running on the same host machine and sharing the same operating system, but abstracts the runtime environment:
The real advantage of containers...