Dependencies and versions
Two common problems that we face in product development are cyclic dependencies and API versions. We'll discuss them in terms of microservice-based architecture.
Cyclic dependencies and their impact
Generally, monolithic architecture has a typical layer model, whereas microservices carry the graph model. Therefore, microservices may have cyclic dependencies.
Therefore, it is necessary to keep a dependency check on microservice relationships.
Let us have a look at the following two cases:
- If you have a cycle of dependencies between your microservices, you are vulnerable to distributed stack overflow errors when a certain transaction might be stuck in a loop. For example, when a restaurant table is being reserved by a person. In this case, the restaurant needs to know the person (
findBookedUser
), and the person needs to know the restaurant at a given time (findBookedRestaurant
). If it is not designed well, these services may call each other in a loop. The result may be...