Paul's Programming Notes     Archive     Feed     Github

Microservice Communication

I’ve been learning more about async communication between microservices and came across this article that talks about some of the trade-offs between sync and async communication: https://dzone.com/articles/patterns-for-microservices-sync-vs-async

Summary

Sync

Pros

  • “synchronous calls are simpler to grasp, debug and implement”

Cons

  • “A temporary burst at one component can flood other services with requests.”
  • Risk of Cascading Failures (domino effect of failures if one service experiences an otuage)
  • tighter coupling (requires endpoint versioning in the owning service)

Async

Pros

  • “removes the need to wait for a response thereby decoupling the execution of two or more services”
  • “deals better with sporadic bursts of traffic”

Cons

  • “Asynchronous systems tend to be significantly more complex than synchronous ones.”
  • “consumers need to adapt to work with an asynchronous system”
  • “the message bus the Achilles heel of the system as it remains a central point of failure”
  • Eventual Consistency (potentially out of date data)