Modular Software Coupling Pitfalls
Software is basically the composition of some modular / single perspective code components, theses components collaborate all together to achieve a significant result, the collaboration is handled by our business centric conditions and makes possible the collaboration of theses components.
This is great theatrically, and with this designs , different steps are monitored using kind of logging via a monitoring tool.
The problematic resolved in following snippet of code is really simple, the system receives an order request , tries to validate that request by verifying the product availability .
This is a simple demonstration example
The problem here that the state of Product service is decoupled to Order repository , Any exception in behalf of Product Service need to be handled in order pipeline .
The main problem here are as :
1- Out of logging system we are not able to have definitive metrics based of Order context, Saying We had N non validated orders in 24h for example or We had N orders for unavailable products during 24h
2- We need to give this part of software all access for Order Infrastructure (Api) / Product Infrastructure (Api) , saying we will have in configuration of this software Two Api Key Ids and this is basically a risk theses days as any compromise access to this app will give more chance to attacker to can access our enterprise private infrastructure tier.
3- Operationally if the Order repository related infrastructure is under pressure and not able to respond you need to retry and reiterate the whole Order Validation process including the product availability as well. this cause the unreal Metrics and logs so you will never be able to observe metrics correctly. and your anomaly detection will not be correctly working.
4- You are not able to version the Product availability independently from Order Validation and registration , the whole coupled modules must be versioned all together and this add complexity and reduce the team speed .
5- Also Evolutions will be coupled in the same way of versioning
6- Performance of Order Validation is coupled to product service and any issue their side will impact your SLA , so you must be able to have insights on your Service in details to improve that incrementally.
7- Resilience of your system is infected by coupled modules as you are not able to detect , retry correctly , If your database is not performing well you need to do an exponential retry as well for Product service but theses are to kind of different infrastructure and the exponential back-off rate can be different so this coupling force you into Coupled configurations.