Pattern 18 / COMMS

Bidirectional Streaming (WebSockets / gRPC Streaming)

Use this when supporting continuous two-way real-time interaction.

Pressure
Supporting continuous two-way real-time interaction
Mechanism
Keep a persistent connection where client and server can send frames whenever state changes
Toll
Millions of open connections need specialized routing, backpressure, and reconnect logic
Architecture plate18
Diagram for Bidirectional Streaming (WebSockets / gRPC Streaming)
Executive brief

Bidirectional Streaming (WebSockets / gRPC Streaming) fits when supporting continuous two-way real-time interaction. Mechanism: keep a persistent connection where client and server can send frames whenever state changes. Use it for chat, multiplayer games, collaborative editing, presence, and live controls. The toll: millions of open connections need specialized routing, backpressure, and reconnect logic.

Use when

Chat, multiplayer games, collaborative editing, presence, and live controls.

Example

Shared document editing over websockets.

Review framing

Describe the pressure first, then the mechanism, then the cost. That keeps the design grounded.

Same pressure family

Communication Patterns

12Request-Response (Synchronous)13Message Queue (Asynchronous)14Publish-Subscribe (Pub/Sub)15Event-Driven Architecture16Webhooks17Server-Sent Events (SSE)
โ† 1719 โ†’