Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Backend Development
2 min read

JSON's Only Advantage Is Readability — Protobuf Dominates Backend Data Transfer

The article argues JSON's sole advantage is human readability, while Protobuf offers schema enforcement, 3-10x smaller payloads, binary encoding with numeric tags, faster parsing, and maturity proven at Google and in gaming, making it superior for production backend services despite being human-unreadable.

JSON: Origin and Single Advantage

JSON originated as a data interchange format from frontend JavaScript, directly mirroring JavaScript object literal syntax. For example:

{
  "name": "Alice",
  "age": 20
}

Before JSON, developers used verbose XML for data exchange. JSON gained popularity because it is concise, readable by humans, and directly parsable by JavaScript engines. The Ajax boom in 2004 cemented its adoption, making it the default interchange format across virtually all programming languages.

However, the author contends that readability is JSON's only genuine advantage. Its widespread use also stems from its lack of patent restrictions, not from technical superiority.

Drawbacks of JSON in Backend Systems

JSON's flexibility — allowing arbitrary addition, removal, or type changes of fields — becomes a liability in long-term backend development. Each { ... } block is independent; there is no guarantee that keys are spelled correctly or match the consumer's expectations. Over time, missing fields or type mismatches cause subtle, hard-to-debug issues.

Protobuf: Schema-First Binary Alternative

Protocol Buffers (Protobuf), created at Google in 2001, addresses these problems. It requires a predefined .proto schema, for example:

syntax = "proto3";

message User {
  int32 id = 1;
  string name = 2;
  string email = 3;
  bool isActive = 4;
}

Each field has a fixed type and a numeric tag (1, 2, 3, 4). The wire format transmits only tags, not field names, eliminating textual overhead. Fields are optional — a message may include only id or any subset — so Protobuf retains JSON's flexibility while enforcing structure.

Because the schema is compiled into code, no manual validation or JSON parsing is needed at runtime. This eliminates type errors at the source, saving significant development time and improving maintainability.

Binary Efficiency and Performance

Protobuf's binary encoding removes whitespace, field names, and JSON syntactic overhead. Internal optimizations further reduce size. The author states that Protobuf payloads are typically 3 to 10 times smaller than equivalent JSON, sometimes even more.

Protobuf binary structure illustration
Protobuf binary structure illustration

Industry Adoption and Recommendation

Protobuf is used extensively inside Google and across the online gaming industry. It runs independently of transport, works with standard HTTP APIs, and is supported by all major programming languages. The author recommends using JSON for debugging (where human readability helps) but switching to Protobuf for production. The trade-off — losing direct readability — is justified by the dramatic gains in performance, bandwidth savings, and correctness guarantees.

For attribution, corrections or content rights, contactadmin@besthub.dev

Report an issue with this article

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion