
Ask HN: If you have 1000 microservices, is hierarchy still an antipattern? - snitko
I&#x27;ve been watching lots of talks on microservices lately - some of them are by people working at big companies that have 1000+ microservices. Strikingly, even at that number, they seem to have a flat structure for those microservices: it is claimed they&#x27;re all independent, yet there certainly is some coupling happening, obscured by the fact that they manage to catch errors post-deployment by carefully rerouting requests to an instance with the previous release of the said microservice - in case the latest release responds with an error (or they use somewhat different in details but similar in spirit techniques).<p>The question I have is: wouldn&#x27;t it make sense to have an hierarchical structure for mircoservices to achieve the following things:<p>1. Ease of understanding and being able to hide the parts of the system you don&#x27;t need&#x2F;want to understand: you&#x27;d only need to follow the branches of hiearchy deep enough to satisfy your necessity to know the details.<p>2. Less chaotic task management: when a task is created by the product manager&#x2F;owner, they might not know and&#x2F;or anticipate which microservices need to be changed to complete the task. With an ierarchical structure, they might as well just assign the task to, say &quot;Authentication Service&quot; project, but changes would have to be made to the &quot;Geolocation service&quot;, &quot;Personal data&quot; and &quot;Access control and denial&quot; services. As a result, a task is automatically (or semi-manually) devided between the teams responsible for those sub-services.<p>3. Explicit coupling declaration: while each service might keep its individual team and deployment independence, hierarchy allows us to see which other services might have an issue with the this particular service after the new release is deployed.<p>What hierarchy actually means - is it purely logical, or does it manifest itself in requests proxying or in some other way - is not that important - it&#x27;d be up for the top-level engineering team to decide.<p>Thoughts?
======
jbn
Hierarchical structure is one way we humans deal with scale, so yes.

To extract structure from large systems, one uses the design structure matrix
(DSM). Look at the Eppinger book.

In software, dependencies are often expressed (in code, in Makefiles, in maven
pom files, etc..) so the structure tends to be hierarchical and not have loops
(i.e. the dependency graph forms a tree), otherwise it's not buildable from
scratch...

