15 Comments
User's avatar
Sathish's avatar

Thanks NK for the detailed explanations. Why does JS doesn’t perform as good as Java or python using Protobuf?

Neo Kim's avatar

JSON is native to JS - and makes it efficient. You can read more about the study: https://auth0.com/blog/beating-json-performance-with-protobuf

Raviraj Achar's avatar

JSON -> Binary, yea totally makes sense for perf wins.

Jean Pierre Erasmus's avatar

Great read, thanks. What would you classify as a big payload?

Neo Kim's avatar

Hey Jean, sorry - I don't have specific numbers. You can read this article to get a better idea: https://auth0.com/blog/beating-json-performance-with-protobuf/

Franco Fernando's avatar

Thanks for the mention NK! I love your newsletter as well.

Neo Kim's avatar

you're welcome.

Frank Dana (FeRD)'s avatar

JSON Schema IS a thing (json-schema dot org), so it's not quite fair to say that there's NO support for schema validation. Protobuf is still always going to win on performance, of course. Especially since adding schema validation to JSON-based APIs only makes them even slower.

Fran Soto's avatar

Thanks for the article NK, really interesting for people like me who didn't work with protocol buffers.

I'd highlight your section on rolling it out. It's easy to design theoretical architectures, another thing is rolling that out in existing services. Makes sense to implement an existing framework, upgrade version, and still have a feature toggle to release in a controlled manner.

Neo Kim's avatar

I appreciate your comment, Fran. Thank you

Jordan Cutler's avatar

Really enjoyed the article and the analogy at the beginning. Thanks, NK

Harshitt Sharma's avatar

Good share!

So you define your message schema in proto file.

This is compiled to generate code in system specific language.This code is Protobuf.

Now this handy code, can be easily imported in to the programs.

We can define our data by hydrating the schema we wrote earlier. Serialising and de-serialising is also easy, as the protobuf file provides methods to do it already!

Giovanny Velez's avatar

How big is "big" in this context?