Get my system design playbook for FREE on newsletter signup:
This post outlines microservices architecture best practices from Netflix. If you want to learn more, scroll to the bottom and find the references.
Share this post & I'll send you some rewards for the referrals.
Microservices Architecture
Netflix runs on AWS. They started with a monolith and moved to microservices. Their reasons for migrating to microservices were the following:
It was difficult to find bugs with many changes to a single codebase
It became difficult to scale vertically
There were many single points of failures
Microservices Challenges and Solutions
3 main problems with microservices architecture are:
Dependency
Scale
Variance
1. Dependency
Here are 4 scenarios where the dependency problem occurs:
i) Intra-Service Requests
A client request results in a service calling another service. Put another way, service A needs to call service B to create a response.

The problem with it is that a failure of a microservice results in cascading failures. The solutions are:
Use the circuit breaker pattern to prevent cascading failures. It avoids an operation that will probably fail
Do fault injection testing to check if the circuit breaker pattern works as expected. It does it by creating artificial traffic
Set up fallback to a static page to keep the system always responsive
Install exponential backoff to prevent thundering herd problem
Yet degraded availability and increased system test scope become a problem. Because availability reduces when the downtime of individual microservices gets combined. And the permutations of test scope grow by a ton as the number of microservices increases.
So it’s important to identify critical services and create a bypass path to avoid non-critical service failures.
ii) Client Libraries
An API gateway allows the reuse of business logic across many types of clients.
An API gateway is a central entry point that routes API requests. But it has the following limitations:
Heap consumption becomes difficult to manage
Potential logical defects or bugs
Potential transitive dependencies
So the solution is to keep the API gateway simple and avoid it from becoming the new monolith.


