ProtocolBuffers

m

Google

History

(evolution of data)

csv

pro

Easy to read

Easy to parse

Easy to make sense of

cons

Data Type has to be inferred : validation is an issue

Parsing is tricky for data that contains commas

Column names aren't strictly enforced : may or may not exist

Relational Tables / SQL

pro

Data is fully typed

Data fits in a table

cons

Data has to be flat to fit in a table

Database has varying definition : working across different databases are difficult

JSON

pro

Can take any forms (arrays, nested elements)

Widely accepted across the web

Easily read by any language

Easily shared over the network

cons

Data has no schema enforcing

JSON objects can be large in size because of repeated keys

No comments, metadata or documentation

protobuf

pro

Human readable

Data is fully typed

Compressed automatically

Schema is needed to generate code and read the data

defined by .proto text file

Documentation can be embedded in the schema

Data can be read across all programming languages

Schema can evolve over time in a safe manner

3-10x smaller and 20-100x faster than XML

Code is generated automatically for you

cons

Can't open in text editor because it's compressed and serialized

Definition

Tutorial

C#

Protocol Buffer Basics: C#

Define message formats in a .proto file.

Use the protocol buffer compiler.

Use the C# protocol buffer API to write and read messages.

Defining your protocol format

Compiling your protocol buffers

Niantics

pgo

game_master.proto

message

GameMasterClientTemplateProto { ... }

// Items client attributes shared from GameMasterTemplateProto. This is the client version of the game master tuning data for items.

holoholo_shared.proto

Click here to center your diagram.
Click here to center your diagram.