EN
返回档案库

案例库 · 软件与 IT · 技术决策 · 2001–2008

这条还没译成中文,下面是英文原文。

Google open-sourced Protocol Buffers and it became the fast data standard

Google defined data once and compiled it into compact binary, then released it; Protobuf beat XML as the busy-API interchange format.

Google

那一手

Google needed to move data between thousands of internal services, but hand-written serialization could not keep up.

Instead of writing bespoke parsers, Google defined each structure once in a small schema language and compiled it into optimized classes.

The resulting binary was far smaller and faster than XML, and in July 2008 Google released the tool to the open source community.

为什么管用

  • Serialization was generated from a schema, so thousands of hand-written parsers disappeared.
  • The binary form was much smaller and faster than XML, which mattered on saturated network links.
  • A simple lists-and-records model avoided the complexity that made other interface description languages bloated.
  • Releasing it as open source in 2008 let outside teams reuse the same efficient format.
值了多少Define once, compile to a compact binary, smaller than XML聪明

可以搬走什么

When hand-written and self-describing formats become the bottleneck, a schema plus generated code buys speed and consistency at scale.

后来呢

Protocol Buffers is now among the most common internal and API serialization formats and underlies gRPC; the schema-driven style spread widely across the industry.

资料来源

发现哪里写错了?告诉我们。

同一路聪明