I was reading an article comparing gRPC and REST on AWS and found a line that confused me. It mentioned that both gRPC and REST utilize asynchronous communication, allowing client-server interactions without interrupting ongoing operations. This doesn't sit right with me. Am I misunderstanding something here? I know that while both can support asynchronous patterns, they're not inherently asynchronous protocols. Generally, true asynchronous communication is achieved using a message broker like Kafka or RabbitMQ. Can anyone clarify this?
3 Answers
You're spot on! The default behavior of both REST and gRPC is synchronous operations. Sure, you can create asynchronous workflows depending on your implementation, like queuing or using brokers, but primarily they operate synchronously.
Both REST and gRPC are indeed synchronous by default, following the request-response approach where the client waits for a response after sending a request. The claim in the article about asynchronous communication might be oversimplified or misleading. Sure, you can implement asynchronous mechanisms on top of them, but fundamentally they are synchronous frameworks. For genuine asynchronous messaging, you might want to look into tools like Kafka or RabbitMQ instead.
REST essentially operates over HTTP and follows a synchronous request-response model. While you can implement API calls with asynchronous functions to avoid blocking your program, this doesn’t mean REST itself is asynchronous. The term 'asynchronous' can be misleading in this context. The original principles of REST focus on being stateless, not asynchronous. I even noticed that the RFCs for HTTP-based APIs don’t include 'asynchronous' anywhere in their definitions.
I totally get that. It annoys me too when people refer to REST as a strict protocol. It’s more of a design philosophy than anything.

Definitely! It makes you realize how many misconceptions are out there. Speaking of REST, I found a link to Roy Fielding's dissertation, which explains these concepts well. It’s worth a read if you haven’t seen it yet!