Skip to content

Comment on Reasons to use protocol buffers instead of JSONparent

Comments

That argument never made sense:

" old readers will consider messages without this field to be incomplete and may reject or drop them unintentionally."

That means the old readers -- the ones that are expecting required fields, can't accept new messages. That's good! The readers don't know how to read the new messages! The readers need to be updated to a new version before they can correctly start reading new version of the schema.

Yeah, the problem is that because "required" is checked at the protobuf parser layer, it will be enforced whether or not the application itself actually depends on that field being present. In practice this tends to escalate minor bugs into full outages. Like, there have actually been outages in Google Search, Gmail, and others that wouldn't have happened if all required fields were treated as optional instead.

I've written more about this here:

https://kentonv.github.io/capnproto/faq.html#how_do_i_make_a...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.