The moment we introduce strong coupling between our services, we lose the potential advantages of a microservice architecture:
We can no longer deploy services independently,
Our teams will spend more time in sync meetings than in the code, and
The system becomes incredibly hard to maintain. It’s expensive.
At the same time, it’s harder to reason about dependencies in a distributed microservice system than a traditional monolith. Part of the reason is that static dependency analyzers tend to break down: in a microservice architecture, there aren’t any explicit dependencies in the code, only indirect dependencies via API calls and messages exchanged over a network.
This article addresses the challenge by introducing the concept of a Change Coupling analysis. Change Coupling is a behavioral code analysis technique that uncovers logical dependencies across servicesandteam boundaries. Let’s see it in action.
Prioritize Dependencies that cross Team Boundaries
Tighly coupled services are problematic in general, but there are different circles in any dependency hell. In particular, dependencies between services that cross team boundaries are expensive and immediately creates delivery bottlenecks. Change coupling lets you visualize those dependencies:
Adam Tornhill is a programmer who combines degrees in engineering and psychology. He’s the founder and CTO of CodeScene where he designs tools for code analysis. Adam is also a recognized international speaker and the author of multiple technical books, including the best selling Your Code as a Crime Scene and Software Design X-Rays. Adam’s other interests include modern history, music, retro computing, and martial arts.
Subscribe to our newsletter
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Semper neque enim rhoncus vestibulum at maecenas.
Ut sociis dignissim.
Latest Articles
Change coupling: visualize the cost of change
Code can be hard to understand due to excess accidental complexity. Or, it can look simple, yet its behavior is anything but due to complex...
CodeScene's IDE Extension brings CodeHealth™ Analysis directly into your editor
We've just launched an IDE Extension for VS Code, helping developers tackle code complexity within the editor. Read more and try it out!
Example of a functional programming refactoring pattern
In this post we'll demonstrate an example of a functional refactoring pattern.