Summary

Microsoft’s official .NET microservices guide chapter on inter-service communication. Core argument: microservices must communicate asynchronously to maintain autonomy and resilience — synchronous HTTP chains create tight coupling and cascade failures. Covers communication type axes (sync/async, single/multiple receivers) and recommends event-driven messaging for internal microservice integration.

微軟 .NET 微服務架構指南中關於服務間通訊的章節。核心論點:微服務必須非同步通訊以維持自主性和韌性,同步 HTTP 鏈造成緊耦合和連鎖故障。涵蓋通訊類型的兩個維度(同步/非同步、單接收/多接收),並建議採用事件驅動訊息傳遞進行內部微服務整合。

Key Points

  • “Smart endpoints and dumb pipes” — microservices own their own logic, pipes just route messages
  • Communication axes: sync vs async × single-receiver vs multiple-receivers
  • Synchronous HTTP chains are an anti-pattern: entire chain fails if one service is slow/down
  • Asynchronous integration (events, queues) maintains microservice autonomy
  • Data ownership: don’t query another service synchronously for data — replicate/propagate the attributes you need with eventual consistency
  • Integration events + event bus are the recommended pattern for propagating state changes

Insights

The hardest part of microservices isn’t the technology — it’s unlearning the assumption that you can call methods synchronously. The document’s recommendation to “replicate some data across services” surprises engineers coming from monoliths (DRY principle), but it’s the correct tradeoff: a bit of data duplication buys you service independence and resilience, which at scale is worth far more than normalized data.

Connections

Raw Excerpt

If possible, never depend on synchronous communication (request/response) between multiple microservices, not even for queries. The goal of each microservice is to be autonomous and available to the client consumer, even if the other services that are part of the end-to-end application are down or unhealthy.