- #1
SlurrerOfSpeech
- 141
- 11
Let's say I run an ecommerce business and I have one service for handling shipping and another service for handling customer profiles such as name, address, age, etc. Call them Customer Management Service and Shipping Service.
SS has an interest in knowing the customer address of which CMS is the source of truth. One way it can get this information is whenever it needs it, with a "get customer info by id" API call.
Many software architectures will say that design creates a "dependency" of SS on CMS and that the dependency could be broken if only CMS published an "address changed" event and SS subscribed to the event and updated its internal copy of the customer address.
Ok, true, now if CMS is down SS can continue to operate. It is "independent" in some sense.
But, does this solve any problem for the entire system? Look at the bigger picture. If CMS service is down, the messages aren't arriving, and we're potentially shipping out products to the wrong addresses. This will need fixed. In fact, this is probably worse than if we couldn't ship anything due to the CMS being down.
SS has an interest in knowing the customer address of which CMS is the source of truth. One way it can get this information is whenever it needs it, with a "get customer info by id" API call.
Many software architectures will say that design creates a "dependency" of SS on CMS and that the dependency could be broken if only CMS published an "address changed" event and SS subscribed to the event and updated its internal copy of the customer address.
Ok, true, now if CMS is down SS can continue to operate. It is "independent" in some sense.
But, does this solve any problem for the entire system? Look at the bigger picture. If CMS service is down, the messages aren't arriving, and we're potentially shipping out products to the wrong addresses. This will need fixed. In fact, this is probably worse than if we couldn't ship anything due to the CMS being down.