Contents
How would you handle multiple instances of microservice?
Multiple Service Instances per Host Pattern. One way to deploy your microservices is to use the Multiple Service Instances per Host pattern. When using this pattern, you provision one or more physical or virtual hosts and run multiple service instances on each one.
What are instances in microservices?
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.
How do you maintain resilience in microservices?
Because microservices communications always take place over the network, those patterns can be directly applied to microservices architecture.
- Timeout. Timeout is a quite common resiliency pattern.
- Retry.
- Circuit breaker.
- Fail-fast.
- Bulkhead.
- Failover and load balancing.
- Reliable delivery.
- Transaction resiliency.
Which of the following is an advantage of multiple service per host deployment pattern?
The Multiple Service Instances per Host pattern has both benefits and drawbacks. One major benefit is its resource usage is relatively efficient. Multiple service instances share the server and its operating system. Another benefit of this pattern is that deploying a service instance is relatively fast.
Why are there multiple instances of the same service?
Why not. If the microservices are stateless or have a shared database backed state then you should be able to have multiple instances of the services behind a network load balancer (F5 big-ip or Microsoft NLB as an example). I am assuming the microservices have a http api (REST).
When to use multiple databases in a microservice?
If you have multiple databases on a single instance then they share the CPU/Memory etc. If your microservice performance is bound by its database performance: then deploying multiple copies of the microservice, each using a different database, but with each database on the same RDS instance.
How are services packaged and deployed in microservices architecture?
You have applied the Microservice architecture pattern and architected your system as a set of services. Each service is deployed as a set of service instances for throughput and availability. How are services packaged and deployed?
How to deploy multiple service instances per host?
There are various ways of deploying a service instance on a shared host including: Deploy each service instance as a JVM process. For example, a Tomcat or Jetty instances per service instance. Deploy multiple service instances in the same JVM. For example, as web applications or OSGI bundles.