REST vs gRPC: when should I choose one over the other?

When done correctly, REST improves long-term evolvability and scalability at the cost of performance and added complexity. REST is ideal for services that must be developed and maintained independently, like the Web itself. Client and server can be loosely coupled and change without breaking each other.

RPC services can be simpler and perform better, at the cost of flexibility and independence. RPC services are ideal for circumstances where client and server are tightly coupled and follow the same development cycle.

However, most so-called REST services don’t really follow REST at all, because REST became just a buzzword for any kind of HTTP API. In fact, most so-called REST APIs are so tightly coupled, they offer no advantage over an RPC design.

Given that, my somewhat cynical answers to your question are:

  1. Some people are adopting gRPC for the same reason they adopted REST a few years ago: design-by-buzzword.

  2. Many people are realizing the way they implement REST amounts to RPC anyway, so why not go with an standardized RPC framework and implement it correctly, instead of insisting on poor REST implementations?

  3. REST is a solution for problems that appear in projects that span several organizations and have long-term goals. Maybe people are realizing they don’t really need REST and looking for better options.

Leave a Comment