Files
system-design-101/data/guides/how-does-grpc-work.md
Kamran Ahmed ee4b7305a2 Adds ByteByteGo guides and links (#106)
This PR adds all the guides from [Visual
Guides](https://bytebytego.com/guides/) section on bytebytego to the
repository with proper links.

- [x] Markdown files for guides and categories are placed inside
`data/guides` and `data/categories`
- [x] Guide links in readme are auto-generated using
`scripts/readme.ts`. Everytime you run the script `npm run
update-readme`, it reads the categories and guides from the above
mentioned folders, generate production links for guides and categories
and populate the table of content in the readme. This ensures that any
future guides and categories will automatically get added to the readme.
- [x] Sorting inside the readme matches the actual category and guides
sorting on production
2025-03-31 22:16:44 -07:00

1.5 KiB
Raw Permalink Blame History

title, description, image, createdAt, draft, categories, tags
title description image createdAt draft categories tags
How does gRPC work? Learn how gRPC works, its data flow, and performance benefits. https://assets.bytebytego.com/diagrams/0210-grpc.png 2024-01-28 false
api-web-development
gRPC
RPC

RPC (Remote Procedure Call) is called “remote” because it enables communications between remote services when services are deployed to different servers under microservice architecture. From the users point of view, it acts like a local function call.

The diagram above illustrates the overall data flow for gRPC.

  • Step 1: A REST call is made from the client. The request body is usually in JSON format.

  • Steps 2 - 4: The order service (gRPC client) receives the REST call, transforms it, and makes an RPC call to the payment service. gPRC encodes the client stub into a binary format and sends it to the low-level transport layer.

  • Step 5: gRPC sends the packets over the network via HTTP2. Because of binary encoding and network optimizations, gRPC is said to be 5X faster than JSON.

  • Steps 6 - 8: The payment service (gRPC server) receives the packets from the network, decodes them, and invokes the server application.

  • Steps 9 - 11: The result is returned from the server application, and gets encoded and sent to the transport layer.

  • Steps 12 - 14: The order service receives the packets, decodes them, and sends the result to the client application.