Protocol Buffers (Protobuf) is a method of serializing structured data useful for transmitting data over the wire or storing it.
In the project directory, you can run:
Then run the index.js file where it will create a file jsonData.json and check the size of this file
Then run the index2.js file where it will create a file protoData and check the size of this file
Now check the differences between the size of generated files in both the cases.
See, length of json data is 130 and that of protobuf it is 51.
So, protobuf is more than half less size of json data. It will be easy to send it in request and also schema you can define plus it is language neutral so once you define proto file it can be output into in any language you want to use.