Chapter 5. Failure Isolation

In a perfect world, bad things would never happen. Sadly, your applications do not inhabit such a magical realm. To paraphrase a fictional mathematician, failure, uh, finds a way. Should you just surrender to the inevitable chaos and let your customers suffer the ramifications? Of course not! Microservices can be used to isolate a dependency, giving you a natural spot to build in proper failover mechanisms. Performing architectural reviews and leveraging patterns like circuit breaker will help your apps thrive within the mayhem of distributed systems.

No Service Is an Island

Digital products don’t live alone. Every piece of tech you use today interacts with something else. The same is true for the custom software you write. Each bit of code works as a part of a larger whole, it’s just one piece of a system that executes a business process. The name isn’t a coincidence: microservice implies interdependence with other services.

Monoliths have plenty of dependencies, too. It’s common for monoliths to integrate with an aging third-party application that you don’t control. Often you are forced to wire these two systems together with baling twine and duct tape. These engineers weren’t masochistic. They did the integration for good business reasons, most likely to provide more complete information or a better user experience.

These integrations are a fact of life in software development. You should expect to have connections between services that were never ...

Get Responsible Microservices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.