Skip to content

Inter-Service Communication

Scope

The protocols, patterns, and architectural styles for communication between services in a distributed system.

Why This Topic Exists

Choosing the right communication method is crucial for designing efficient, scalable, and resilient distributed systems. The decision impacts performance, reliability, and the overall architectural design.

Core Tradeoffs

  • Synchronous vs. Asynchronous communication
  • Reliability vs. performance (e.g., TCP vs. UDP)
  • Tight vs. loose coupling (e.g., RPC vs. REST)
  • Real-time push vs. client pull (e.g., WebSockets vs. HTTP polling)

Common Failure Modes

  • Cascading failures from blocked synchronous calls
  • Network partitions leading to service unavailability
  • Message loss or duplication in asynchronous systems
  • Versioning conflicts and brittleness from tightly coupled RPCs

Interview Signals

Strong candidates weigh the tradeoffs between different communication styles, such as REST, gRPC, and message queues. They can justify their choices based on specific use cases, like real-time updates or background job processing, and discuss failure handling in each.

  • Messaging
  • Reliability
  • Scalability
  • Service Discovery