Which of the following transport protocols is most suitable for low-latency, high-throughput communication between microservices in a distributed system?
Think about protocols designed for fast, efficient communication with support for streaming and multiplexing.
gRPC uses HTTP/2 which supports multiplexing and binary framing, making it ideal for low-latency and high-throughput microservice communication. HTTP/REST is simpler but less efficient. SMTP and FTP are not designed for microservice communication.
You are designing an event-driven microservice system where services communicate asynchronously. Which transport mechanism below best supports asynchronous message passing with guaranteed delivery?
Look for a message broker that supports queues and acknowledgments.
RabbitMQ uses AMQP which supports asynchronous messaging with guaranteed delivery and message acknowledgments. WebSockets and HTTP polling are less reliable for guaranteed delivery. gRPC unary calls are synchronous.
When scaling microservices horizontally, which transport approach minimizes connection overhead and supports load balancing effectively?
Consider how connection reuse and multiplexing affect resource usage and load balancing.
HTTP/2 allows multiplexing many requests over a single persistent connection, reducing overhead and improving load balancing. HTTP/1.1 and opening new TCP connections increase overhead. UDP is unreliable and not suitable for most microservice communication.
Which statement correctly describes a tradeoff when choosing synchronous (e.g., HTTP/gRPC) versus asynchronous (e.g., message queues) transports for microservices?
Think about how asynchronous messaging affects timing and reliability.
Asynchronous transports improve fault tolerance by decoupling services and allowing retries, but they introduce latency due to queuing. Synchronous transports have lower latency but tighter coupling. Message delivery guarantees depend on implementation, not just sync/async.
You have a microservice system using RabbitMQ for asynchronous messaging. Each message is 1 KB. The system expects 10,000 messages per second. Estimate the minimum network bandwidth in Mbps required to handle this load without bottlenecks (assume 8 bits per byte).
Calculate total bits per second: message size in bytes × 8 × messages per second, then convert to Mbps.
1 KB = 1024 bytes, so 1024 × 8 = 8192 bits per message. For 10,000 messages per second: 8192 × 10,000 = 81,920,000 bits per second ≈ 81.92 Mbps. The closest option is 80 Mbps.