|
Json |
PB |
Data structure Support |
Simple structure |
More complex structures |
Data format |
Text |
Binary |
Data size |
So so |
Small, JSON size of about 1/3 |
Analytic efficiency |
So so |
Fast, it's 3-10 times the JSON parsing speed. |
Readability |
Well, self-describing |
In general, a. proto file is required, otherwise reading code is difficult to understand |
Language support |
Many Java/oc/php have a better library |
General, official support C/java/python Oc/php has an open source library |
Development cost |
Low |
Typically, you need to generate a proto class for each interface |
Scalability |
Same, add or remove fields can be compatible |
Same, add or remove fields can be compatible |
Security |
No, self-encrypting required |
Natural encryption, unable to decipher interface |
Application |
High visibility, good promotion |
Slightly poor visibility, promotion in |
Protocol Buffer and JSON performance comparison