Benchmarking — REST vs. gRPC

Recep İnanç
Sahibinden Technology
9 min readJan 7, 2021

--

Comparing “gRPC + Protocol Buffers (Protobuf)” and “REST + JSON”

Photo by Mitchel Boot on Unsplash

TL;DR

Designing your API using gRPC with Protocol Buffers (Protobuf) is more performant compared to using REST and JSON.

The main reasons being:

  • gRPC uses as its transfer protocol HTTP/2.0 — better connection management.
  • Protobuf transports data in binary format — easier serialization/deserialization.

Please see the full project at Github.

Acknowledgment

Since the benchmarking is conducted on my local machine, and I acknowledge that it just demonstrates their performances relative to each other. And the sole purpose of this blog post is to share my experiences about the process and give a little bit of theory into these topics.

As we are all witnessing the world moving towards the microservices architecture, gRPC’s popularity is on the rise. It is because it is said to be more performant than REST and its drawbacks are somewhat negligible if we are planning to use it to design our internal APIs.

So, I wanted to experiment with the implementation of such API, its interaction with other frameworks and, its performance compared to REST APIs using JMeter.

--

--

Recep İnanç
Sahibinden Technology

Software Developer @Amazon. You can find me at recepinanc.com. My opinions are my own.