When managing complexity of the system, itโ€™s important to optimize both complexities - local and global.

When optimizing only global complexity, it leads to all functionality implemented in a one monolithic service. It may be okay, but also may lead to the big ball of mud in local complexity.

When optimizing only local complexity and neglecting the systemโ€™s global complexity it may lead to a distributed big ball of mud.

Deep module concept can be applied to address this. A deep module reduces global complexity, and the Shallow module increases it.