/protocol-buffers-example

a example use of Protobufs for learning.

Primary LanguageJavaScript

Protocol Buffers Example

What are protocol buffers?

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

Benefits of ProtoBuf

  • Schema driven
  • Binary & a very compact size
  • Language neutral

Cons of ProtoBuf

  • Have to have structured data (barrier to entry)
  • More involved processes for small applications.
  • Can be overkill for getting started quickly.
  • Have to make sure to update compiled boilerplate code (bugs, security vulnerability, etc.)
  • Hard to use with JSON based applications (Javascript/browser)

JSON vs Binary data

As you can see the data generated from using protobufs is much smaller than JSON.

comparison