# protobuf

Published articles for protobuf.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Transitioning from REST to gRPC: System Design and Tradeoffs

DevFeed: [Transitioning from REST to gRPC: System Design and Tradeoffs](<https://devfeed.tech/articles/transitioning-from-rest-to-grpc-system-design-and-tradeoffs-39558.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/06-grpc-vs-rest/>)

Author: hello@ankit-rana.com

Published: 2026-03-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [gRPC](<https://devfeed.tech/topics/grpc.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>), [Code](<https://devfeed.tech/topics/code.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [api-design](<https://devfeed.tech/tags/api-design.md>), [client](<https://devfeed.tech/tags/client.md>), [grpc](<https://devfeed.tech/tags/grpc.md>), [http](<https://devfeed.tech/tags/http.md>), [json](<https://devfeed.tech/tags/json.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [protobuf](<https://devfeed.tech/tags/protobuf.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rpc](<https://devfeed.tech/tags/rpc.md>), [schema](<https://devfeed.tech/tags/schema.md>), [server](<https://devfeed.tech/tags/server.md>), [system-design](<https://devfeed.tech/tags/system-design.md>)

### AI overview

This tutorial explains how gRPC uses .proto service definitions and Protocol Buffers to generate typed client and server code, serialize messages, and communicate over HTTP/2. It compares gRPC with REST and recommends gRPC for internal service-to-service calls needing low latency, schema-first contracts, or streaming, while retaining REST with JSON at the edge for browsers and external consumers.

### Source excerpt

gRPC defines services in a .proto file, compiles them into typed client and server code, and transports binary protobuf over HTTP/2. Choose it for internal service-to-service calls that need low latency, schema-first contracts, or streaming, and keep REST with JSON at the edge where browsers and external consumers live.

## Reverse Engineering Protobuf Definitions From Compiled Binaries

DevFeed: [Reverse Engineering Protobuf Definitions From Compiled Binaries](<https://devfeed.tech/articles/reverse-engineering-protobuf-definitions-from-compiled-binaries-42000.md>)

Original publisher: [Read original article](<https://arkadiyt.com/2024/03/03/reverse-engineering-protobuf-definitiions-from-compiled-binaries/>)

Published: 2024-03-03T08:00:00Z

Content type: tutorial

Language: en

Sources: [Arkadiy Tetelman](<https://devfeed.tech/sources/arkadiy-tetelman.md>)

Topics: [Reverse Engineering](<https://devfeed.tech/topics/reverse-engineering.md>), [API](<https://devfeed.tech/topics/api.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [cli](<https://devfeed.tech/tags/cli.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [golang](<https://devfeed.tech/tags/golang.md>), [protobuf](<https://devfeed.tech/tags/protobuf.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>)

### AI overview

This tutorial explains how protodump extracts protobuf definitions from compiled binaries. It covers how protoc-generated Go code stores FileDescriptor data, how runtime reflection uses those definitions, and how to locate and decode the embedded data in a binary.

### Source excerpt

A few years ago I released protodump, a CLI for extracting full source protobuf definitions from compiled binaries (regardless of the target architecture). This can come in handy if you're trying to reverse engineer an API used by a closed source binary, for instance. In this post I'll explain how it works, but first, a demo: How does it work? To understand how it works, lets take a look at a small test.proto example: syntax = "proto3"; option go_package = "./;helloworld"; message HelloWorld { string name = 1; } If we compile this with protoc to golang we'll get some golang code that defines the object type, creates getters and setters for the name field, and so on. We can use it as follows: func main() { obj := helloworld.HelloWorld{ Name: "myname", } fmt.Printf("%s\n", obj.GetName()) } $ go run main.go myname However protobuf also supports runtime reflection. Rather than invoking the getter method at compile time, we can fetch the list of fields and query them at runtime: func main() { obj := helloworld.HelloWorld{ Name: "myname", } fields := obj.ProtoReflect().Descriptor().Fields() for i := 0; i < fields.Len(); i++ { field := fields.Get(i) value := obj.ProtoReflect().Get(field).String() fmt.Printf("Field %d has value '%v'\n", i, value) } } $ go run main.go Field 0 has value 'myname' How can the generated golang code know the field names and types at runtime like this? The protoc compiler stores a whole copy of the protobuf definition in the generated output code. Here is the complete protoc output for our HelloWorld message type, and in particular, lines 72-78 store this protobuf definition: var file_test_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x68, 0x65, 0x6c, 0x6c

## RPC 漫谈：序列化问题

DevFeed: [RPC 漫谈：序列化问题](<https://devfeed.tech/articles/rpc-40977.md>)

Original publisher: [Read original article](<https://blog.joway.io/posts/deep-into-rpc-serialization/>)

Author: Joway

Published: 2021-04-30T00:00:00Z

Content type: tutorial

Language: zh

Sources: [Random Thoughts](<https://devfeed.tech/sources/random-thoughts.md>)

Topics: [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>), [Code](<https://devfeed.tech/topics/code.md>), [interface](<https://devfeed.tech/topics/interface.md>), [class](<https://devfeed.tech/topics/class.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [client](<https://devfeed.tech/tags/client.md>), [code](<https://devfeed.tech/tags/code.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [protobuf](<https://devfeed.tech/tags/protobuf.md>), [remote-procedure-calls](<https://devfeed.tech/tags/remote-procedure-calls.md>), [rpc](<https://devfeed.tech/tags/rpc.md>), [service-mesh](<https://devfeed.tech/tags/service-mesh.md>), [tech](<https://devfeed.tech/tags/tech.md>)

### AI overview

This article explains RPC serialization and deserialization, including IDL definitions, generated Stub code, reflection, and encoding techniques such as Varint and ZigZag. It discusses trade-offs between generated code size, convenience, performance, and network payload size.

### Source excerpt

何为序列 对于计算机而言，一切数据皆为二进制序列。但编程人员为了以人类可读可控的形式处理这些二进制数据，于是发明了数据类型和结构的概念，数据类型用以标注一段二进制数据的解析方式，数据结构用以标注多段(连续/不连续)二进制数据的组织方式。 例如以下程序结构体：