Reputation: 15
1)If 2 microservices (say order and payment services) can connect asynchronously, then we can avoid using circuit/retry/throttle patterns, right?
I really dont understand why going synchrnous approach and using these patterns again? I mean using synchronous approach will have scalabale issues, right? Synchronous usecase should be only when some cache can be provided (say Order status can be asked via Synchronous and this can be cached as well)..
Am really not getting when really we have to chose synchronous/asynchronous between services... In internet says, avoid synchronous approach totally to avoid scalable issues and also saves lot money..
Upvotes: 0
Views: 177
Reputation: 86
Few points to add to the other answer, why I would stress async communication is definitely not a silver bullet:
Basically it is ideal to take expected scale into account and verify the pros and cons of one vs the other before landing on a solution.
Upvotes: 1
Reputation: 1786
If your business requirements and existing tech setup allows, async communication is the way to go for the points you mentioned and for many others you didn't.
But you need to be aware of the caveats. Async is harder to implement then the sync one. It is also harder to debug and troubleshoot. You may also need some additional components to implement a reliably async communication. That means additional setup, configuration and maintenance etc.
Additionally in many occasions you can't implement this integration simply because of the business requirements. if for example the client expects a sync response from one your of backends you will have issues with this setup.
All in all after a decade of different shape and size of microservices project experience I would say async communication is not a silver bullet. Though I would try to go with it if possible that would not always be the case.
Upvotes: 1