L6 - Monolithic vs. Microservice Application Architecture 2/2 Flashcards
Cons of client-side service discovery
- couples the client with the service registry
- implementation of client-side service discovery logic for each programming language and framework used by service clients
What is server-side discovery?
- client requests a service via a load balancer
- the load balancer queries the service registry and routes each request to an available service instance
Example of server-side service discovery
AWS Elastic LB
Pros of server-side discovery
- details of the discovery are abstracted away from the client
- eliminates the need to implement discovery logic for each programming language and framework used by your service clients
Cons of server-side discovery
- requires load balancer
Immediate failure
Timeout fialure
Cascade failure
Timeout Failure Solution
order service stops calling for some time. Then calls to the payment service are allowed partially.
What is a circuit breaker?
It intercepts all requests from the order service to the payment service.
How does the circuit breaker work?
What is ramped - slow roll out?
the number of instances of the old version is decreased and the new version is increased until the correct number of service instances is reached
Pros of ramped - slow roll out?
- version is slowly released across instances
- convenient for stateful applications that can handle rebalancing of the data
What is a stateful application?
Stateful applications save data to persistent disk storage for use by the server, by clients, and by other applications.
What are the cons of a ramped - slow roll out?
- rollout/rollback can take time
- supporting multiple APIs is hard
- no control over traffic
What is Blue/Green?
- the green version of the application is deployed alongside the blue version. After testing the new version, update the load balancer to send traffic to the new version.
Pros of Blue/Green?
- instant rollout/rollback
- avoid versioning issues
Cons of Blue/Green?
- requires double the resources
- proper test of the entire platform should be done before releasing to production.
What is canary deployment?
- a canary deployment consists of routing a subset of users to a new functionality
- e.g. 35% of traffic to new version
Pros of Canary
- version released for a subset of users
- convenient for error rate and performance monitoring
- fast rollback
Cons of Canary
- slow rollout
- fine-tuned traffic distribution can be expensive
What is A/B testing?
- distributing traffic amongst versions based on a few parameters (cookie, user agent, etc.)
Pros of A/B testing
- intelligent load balancing
- several versions running in parallel
- full control over the traffic distribution