gRPC in NestJS, for Spring Developers: 1999 Plus 1 Is "19991"

1 October 2026 nestjstypescriptnodejsjavaspring-bootgrpc
PDF The design sheet The full architecture and the verified references. Free, no email.
Thumbnail for gRPC in NestJS, for Spring Developers: 1999 Plus 1 Is "19991" 3:45
Watch on YouTube, or read on below.
Run this yourself → Clone the repo, docker compose up, and watch it happen

One payments.proto, served by Spring Boot and by NestJS. A payment of 1999 cents arrives and the handler adds one: 2000 on Spring, "19991" on Nest. Measured on 1 October 2026. Same proto, different runtime types.

The 64 bit integer

Java mapped int64 to a long. Nest passes its loader options straight to @grpc/proto-loader, and with none the amount arrived as a Long object: typeof object, zero not equal to 0, and plus one joined strings. With longs: Number it was a number again, but a value just past 2^53 arrived one lower. That is JavaScript numbers, not gRPC. Pick the representation deliberately.

Errors and deadlines

A handler that threw was masked on both stacks: UNKNOWN, with a generic description. A client that set a 300 ms deadline on a one second charge got DEADLINE_EXCEEDED on both, and the server completed the charge anyway on both. A deadline stops the waiting, not the work: check for cancellation before the step with the side effect, and make that step idempotent.

The full code for every measurement is in the repository, and the free design sheet above has the checklist on one page.


Watch next

New videos land on Code with Sam - subscribe there if this was useful.

Get the interview pack

A free, practical pack for engineers preparing for senior backend interviews - the questions that actually get asked, and how to answer them like someone who has done the work.

New articles and videos when they land. No spam, and one click to leave.