QA
Senior LevelREST APIs & Web Services

Compare gRPC Server Streaming vs WebSockets for high-frequency real-time telemetry.

❓ Interview Prompt: Compare gRPC Server Streaming (HTTP/2 multiplexed, strongly-typed binary Protobuf) vs WebSockets (full-duplex TCP socket, manual frames, browser compatibility).

Architectural comparison for high-frequency real-time data delivery:

| Feature | gRPC Server Streaming | WebSockets |

|---|---|---|

| Protocol | HTTP/2 (Single directional stream) | TCP Full-Duplex Socket |

| Data Format | Binary Protobuf (Strongly typed) | Text/JSON or raw ArrayBuffers |

| Multiplexing | Native HTTP/2 stream multiplexing | Requires custom framing protocol |

| Browser Support | Requires gRPC-Web proxy bridge | Native browser 'WebSocket' API support |

| Best For | Internal microservice real-time telemetry | Browser client interactive chat/collaboration |

Code Implementation Example

yaml
# gRPC Server Streaming Protobuf definition:
service TelemetryService {
  rpc StreamMetrics (MetricRequest) returns (stream MetricData);
}
💡gRPC Server Streaming Protobuf service definition.
🎯 Interview Key Takeaway

Use WebSockets for interactive browser applications; use gRPC Server Streaming for high-throughput internal microservice telemetry.

#gRPC Streaming#WebSockets#Real-Time#Senior
Back to all REST APIs & Web Services Questions→

More REST APIs & Web Services Interview Questions

Beginner LevelREST APIs & Web Services

What is HTTP Method Idempotency and how do you implement Idempotency Keys for REST APIs?

Beginner LevelREST APIs & Web Services

What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?

Beginner LevelREST APIs & Web Services

What are HTTP Verbs (GET, POST, PUT, PATCH, DELETE) and when to use PUT vs PATCH?