What is the difference between MessagePack, Protobuf and JSON ? Can anyone tell me which one to use when

938 Views Asked by At

I need to understand the difference between - message pack - protocol buffers - JSON

1

There are 1 best solutions below

0
Thorsten Dittmar On BEST ANSWER

Without having jumped in deeply into the matter I'd say the following:

All three are data formats that help you serialize information in a structured form so you can easily exchange it between software components (for example client and server).

While I'm not too familiar with the other two, JSON is currently a quasi-standard due to the fact that it is practically built into JavaScript - it's not a coincidence it is called JavaScript Object Notation. The other two seem to require additional libraries on both ends to create the required format.

So when to use which? Use JSON for REST services, for example if you want to publish your API or need different clients to access it. JSON seems to have the broadest acceptance.