According to this approach, we deploy a single instance of a microservice on its own single host. A service instance is deployed to its own host and each service instance runs independently. This approach has two specific patterns:
A single instance of a microservice per VM
A single instance of a microservice per container
A host can be a physical machine, a virtual machine, or a container such as a Docker container. The following diagram demonstrates this approach of deploying microservices:
As you can see in the preceding diagram, there is a number of hosts, each of which holds several instances of services. Each service instance has been deployed on its own host machine, that is either a VM or a container. Let's now discuss the benefits and drawbacks of this approach.
Benefits
This approach has the following benefits:
It provides complete isolation between instances of microservices
We can easily correct a defective service without affecting other services
There is no resource utilization conflict between instances of microservices because each service runs on a separate host using its own resources; in other words, there are no resources shared between instances of microservices
We can assign a specific amount of resources to a microservice instance on demand
We can easily monitor, manage, and redeploy each service instance
Drawbacks
However, this approach has the following drawback:
It has less efficient resource utilization compared to with multiple instances of microservices per host