Protocol Buffer vs Json – when to choose one over another

When to use JSON

  • You need or want data to be human readable
  • Data from the service is directly consumed by a web browser
  • Your server side application is written in JavaScript
  • You aren’t prepared to tie the data model to a schema
  • You don’t have the bandwidth to add another tool to your arsenal
  • The operational burden of running a different kind of network service
    is too great

Pros of ProtoBuf

  • Relatively smaller size
  • Guarantees type-safety
  • Prevents schema-violations
  • Gives you simple accessors
  • Fast serialization/deserialization
  • Backward compatibility

While we are at it, have you looked at flatbuffers?

Some of the aspects are covered here google protocol buffers vs json vs XML

Reference:

https://codeclimate.com/blog/choose-protocol-buffers/

https://codeburst.io/json-vs-protocol-buffers-vs-flatbuffers-a4247f8bda6f

Leave a Comment