Explain gRPC Streaming vs Unary Calls.

gRPC unary calls send one request and receive one response, while gRPC streaming allows continuous sending or receiving of multiple messages over a single connection.

When to Use

  • Unary: Best for simple operations like login requests, fetching a profile, or one-off queries.
  • Streaming: Ideal for real-time use cases like chat apps, stock tickers, IoT telemetry, or video streaming.

Example

A messaging app might use streaming to deliver a live chat feed, while fetching a user’s profile remains a unary call.

Want to master these trade-offs?

Explore Grokking System Design Fundamentals, Grokking the Coding Interview, or practice with Mock Interviews with ex-FAANG engineers.

Why Is It Important

Picking the right RPC type affects performance, scalability, and cost. Streaming avoids repeated handshakes, improving throughput, while unary calls keep services stateless and easier to scale.

Interview Tips

  • Define both clearly.
  • Give one real-world example for each.
  • Mention efficiency, scalability, and error handling.
  • Bonus: Highlight that gRPC uses HTTP/2 streams under the hood.

Trade-offs

  • Unary: Simpler, stateless, easy load-balancing.

  • Streaming: Higher throughput, less overhead, but adds complexity in error handling and state management.

Pitfalls

  • Using streaming for simple tasks can add unnecessary complexity.
  • Forgetting to close or cancel streams leads to resource leaks.
  • Assuming streaming is always faster—sometimes unary performs better depending on workload.
TAGS
System Design Interview
System Design Fundamentals
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Image
One-Stop Portal For Tech Interviews.
Copyright © 2025 Design Gurus, LLC. All rights reserved.