REST API vs gRPC: When Should You Start Moving Off JSON?

Has your microservice system started feeling heavy even though it only shuffles internal data? The server may not be the problem. Here is when REST + JSON still wins, and when gRPC is the answer.

Read in Indonesian

Almost all of us started our backend journey by building REST APIs on JSON. There is nothing wrong with that. The format is human-readable, easy to test with Postman or cURL, and nearly every programming language on earth understands it. You hit the endpoint, you get JSON back. Simple, right?

But once your system turns into a microservices architecture, with dozens or even hundreds of internal services exchanging data millions of times per second, the overhead of JSON and HTTP/1.1 starts to show. Does it really? Yes. 😅

That is where gRPC (Google Remote Procedure Call) comes in as a high-powered alternative for internal service-to-service communication. Let's take it apart together.

Key takeaways

  • REST APIs with JSON still win for public APIs and for web and mobile frontend integration.
  • gRPC uses HTTP/2 multiplexing and Protocol Buffers for binary serialization that is far more compact.
  • Combining both is ideal for cutting network latency and CPU overhead on internal microservice traffic.
  • A .proto contract schema gives you built-in type safety plus multi-language code generation.

REST APIs with JSON dominate the software industry for good reasons:

  1. Very easy to read. Data is plain text like {"nama": "Inva", "role": "Developer"}, readable with no special decoder.
  2. Flexible and dynamic. No rigid schema required at the transport protocol level.
  3. Browser standard. Web browsers consume JSON payloads natively with no trouble.

This text format is already a native tongue for frontend developers. Open DevTools, look at the Network tab, and the data is readable with the naked eye. No extra tools required.

The Limits of REST & JSON at Microservice Scale

Friendly to developers is not the same as friendly to the server. Once internal traffic climbs, the REST + JSON combination starts showing its real teeth:

  • Large payloads. JSON carries a lot of redundant characters: spaces, curly braces, double quotes, plus field names like "nama_lengkap" repeated in every list item.
  • Slow parsing. Turning a JSON string into an in-memory object in Python, Java, or Go burns a fair number of CPU cycles.
  • HTTP/1.1 is behind the times. Traditional REST APIs use HTTP/1.1 by default, which is prone to head-of-line blocking and does not support true multiplexing on one TCP connection.

Picture sending parcels with a courier whose motorbike carries one box per trip. For a monthly shipment, that is fine. For a shipment every second, it is a mess. 😂

Meet gRPC: What It Is and How It Works

gRPC is an open-source framework from Google for Remote Procedure Call (RPC) communication. With gRPC, one service can call a function in another service as if that function lived in its own local program.

Two main pillars make gRPC fast:

  1. HTTP/2. A single persistent connection with multiplexing, so many requests and responses travel together on one TCP connection, plus header compression and two-way streaming (bidirectional).
  2. Protocol Buffers (Protobuf). A binary data serialization mechanism with a strongly typed schema that is far smaller and faster than JSON.

Protocol Buffers vs JSON: How Is It More Compact?

With Protobuf, you define the communication contract schema in a .proto file:

PROTOBUF
syntax = "proto3";

package user;

message UserRequest {
  int32 id = 1;
}

message UserResponse {
  int32 id = 1;
  string name = 2;
  string email = 3;
}

service UserService {
  rpc GetUser (UserRequest) returns (UserResponse);
}

Now, when data travels over the network, Protobuf does not send field names like "name" or "email". It sends only binary tag numbers (1, 2, 3) and the values as a binary stream.

The result is fairly wild:

  • Data size can be 3x to 10x smaller than JSON.
  • Serialization and deserialization can be 5x to 8x faster, because the work happens directly at the binary level.

For one request, you may not notice the difference. For a million requests per second, the gap turns into a cloud bill that differs by a hair. 🤔

Paper Mail vs Telegram Signals

To make it easy to picture:

  • REST + JSON is like sending a handwritten paper letter complete with letterhead and stamps. The recipient can read the contents with the naked eye, but the postage and the folding time take up room in the mail carrier's bag.
  • gRPC + Protobuf is like sending compressed binary telegraph code down a dedicated fiber cable. A human cannot read it without a translation machine, but transmission and decoding are lightning fast.

The first suits love letters. The second suits stock exchange data every millisecond. You need both, they just fight on different ground. 😎

When to Use REST, When to Use gRPC?

Requirement / Scenario Use REST API Use gRPC
Communication With Frontend / Mobile App / Web ✅ Strongly Recommended ⚠️ Needs gRPC-Web / Proxy
Internal Communication Between Microservices ⚠️ Possible, but high overhead ✅ Strongly Recommended
Public API for External Developers ✅ Industry Standard ❌ Less friendly to general users
Real-Time Data Streaming Needs ⚠️ Needs WebSocket/SSE ✅ Built Into HTTP/2 Streaming
Low Latency & High Throughput Systems ❌ Constrained by JSON parsing ✅ Very Fast & Efficient

Looking at the table above, the pattern is clear: REST outward, gRPC inward. Frontends and mobile apps do not need to import a .proto, they are already comfortable with JSON. And when you need two-way streaming, gRPC gives you that with no extra tooling.

So, Is It Time to Migrate to gRPC?

REST APIs and JSON are clearly not going extinct any time soon. Both remain the gold standard for public APIs and user interfaces (web and mobile frontends).

But once your system architecture turns into a microservices ecosystem exchanging data millions of times per second, moving to gRPC and Protocol Buffers becomes a strategic move. Network latency shrinks, bandwidth is saved, and server CPUs stay cool.

Start with one internal service. There is no need to migrate everything overnight. A migration that moves slowly but surely usually outlasts a big-bang rewrite. 😄

Happy architecting, and may your latency always sit under one millisecond. 👋

Inva

Writer

Get better at shipping code.

Join the other developers getting tech updates, tips, and relaxed tutorials in their inbox every week.

Stay in the loop

Tech updates, coding tips, and relaxed insights straight to your inbox every week.

No spam. Unsubscribe anytime.

Read next

See all

For developers who learn by struggling

© 2026 Inva.dev.