I recently came across an AWS article comparing gRPC and REST, and it mentioned that both protocols support asynchronous communication, allowing clients and servers to operate without interrupting each other. I find this a bit confusing and wonder if I'm misunderstanding something. While gRPC and REST can certainly be implemented with asynchronous patterns, aren't they fundamentally synchronous protocols? For pure asynchronous communication, I thought we typically use message brokers like Kafka or RabbitMQ. What's everyone's take on this?
5 Answers
It really depends on perspective. While HTTP requests are synchronous in nature, I/O operations can be asynchronous. So during a long wait for a response, you could technically be handling other requests, making the experience feel asynchronous. But I get why AWS's phrasing might confuse some people.
REST can actually be both! If you wait for a REST service to finish before continuing, that's synchronous. But if you set a callback and move on while waiting for a response, then it’s asynchronous.
I think it's confusing to label these as synchronous or asynchronous outright. They are communication protocols and how you handle them depends on your application. If you're looking at whether they guarantee message reception, that's a different story—typically, you'd use a message queue for that.
REST isn’t strictly synchronous. The client-side implementation might work that way, but the protocol itself is more flexible than that.
True, a response always follows a request, but it can be designed to work asynchronously with non-blocking I/O, so it feels asynchronous in practice.
Yes, REST is synchronous in that you send a request and expect a response. However, it can utilize non-blocking I/O, which means the server can handle multiple requests without being tied up. For processes that take more time, like uploads, there are patterns for managing job statuses from different requests instead of waiting for one single callback.

Exactly! It’s all about how you design the requests.