Blog

REST Is Lazy. Use gRPC For Real Systems

contracts over loose json
Rusty REST steam train being overtaken by a glowing gRPC bullet train

REST is fine for many public APIs. For internal high-throughput service-to-service calls, JSON over HTTP often becomes lazy default, not deliberate choice.

If your fintech platform moves serious traffic between services, gRPC deserves attention.

JSON Is Expensive Flexibility

JSON is human-readable. It is also verbose, loosely typed, and easy to evolve badly.

Internal services do not need every payload to be readable in browser. They need fast serialization, strict contracts, streaming when useful, and generated clients.

Protobuf Contract

syntax = "proto3";

package ledger.v1;

service LedgerService {
  rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse);
}

message GetBalanceRequest {
  string account_id = 1;
}

message GetBalanceResponse {
  string account_id = 1;
  string currency = 2;
  int64 minor_units = 3;
}

Fields have numbers. Contract is compiled. Client and server share exact shape.

Java Client Shape

ManagedChannel channel = ManagedChannelBuilder
    .forAddress("ledger", 9090)
    .usePlaintext()
    .build();

LedgerServiceGrpc.LedgerServiceBlockingStub ledger =
    LedgerServiceGrpc.newBlockingStub(channel)
        .withDeadlineAfter(200, TimeUnit.MILLISECONDS);

GetBalanceResponse response = ledger.getBalance(
    GetBalanceRequest.newBuilder()
        .setAccountId("acc-123")
        .build()
);

Deadline is explicit. Types are generated. Payload is binary.

REST Still Has Place

Use REST for public APIs, browser clients, simple CRUD, and integration with external partners. It is universal and debuggable.

Use gRPC when internal contract stability, performance, streaming, and generated clients matter more.

Trade-Offs

gRPC adds tooling, Protobuf discipline, gateway story for browsers, and different operational debugging. It is not magic powder.

But neither is REST. JSON endpoint with no schema, no versioning, and random nulls is not architecture.

Final Rule

Choose protocol. Do not inherit it from tutorial.

If communication is internal, high-volume, and strongly typed, gRPC may be the adult option. REST is fine when you choose it with eyes open.