gRPC vs. REST — Performance Test using JMeter

KNNX Corp.
KNNX Corp.
Published in
4 min readMay 11, 2022

--

gRPC vs. REST — Performance Test using JMeter

What is gRPC?

gRPC is an open-source Remote Procedure Call, initially developed at Google in 2015. In 2017, it became a Cloud Native Computing Foundation (CNCF) incubation project due to increasing popularity.

The gRPC framework is used to build scalable and high-performance APIs. Many top organizations leverage it to power their user cases, from microservices to the web, mobile, and IoT.

It uses Protobuf (protocol buffer) as IDL (Interface Definition Language) to store data and function contracts in the form of a .proto file.

gRPC vs. REST: Key takeaways

  • RESTful APIs use HTTP/1.1, whereas gRPC is based on HTTP/2
  • gRPC uses a protocol buffer to serialize payload data, which is binary and smaller. While REST uses JSON, which is text and larger.
  • The API contract in gRPC is strict and must be clearly defined in the proto file. While in REST, it is often loose and optional. We can define it via OpenAPI, but it is not mandatory.

Performance Test

I have created a small Node.Js-based service for this gRPC vs. REST performance test.

Test scenario: A single method is created, which accepts a number and returns its square. gRPC…

--

--

KNNX Corp.
KNNX Corp.

KNNX is a global leader in Distributed Ledger Technology and Enterprise Products. To learn more, head over to: https://www.knnx.com/