Microservices can improve scalability, deployment flexibility, and team autonomy. But they also introduce network communication, distributed data management, and operational complexity. A poorly designed microservices architecture can be more difficult to maintain than the monolith it replaced. This happens when teams adopt microservices without understanding the trade-offs or apply distributed systems patterns incorrectly.
These recurring design mistakes are called microservices anti-patterns. An anti-pattern is an approach that may seem reasonable initially but repeatedly creates problems as the system grows. In this chapter, we'll examine the most common microservices anti-patterns, explain why they cause problems, and discuss how to avoid them.