3 ms·
I think the missing assumption is that doing "just protobuf" is not always a possibility when you in the end have an open API front-facing the internet. So now
by C4stor 7y ago
I think the missing assumption is that doing "just protobuf" is not always a possibility when you in the end have an open API front-facing the internet.
So now there is a point in your codebase where you are receiving data in a JSON form. At this point having protobuf elsewhere is not chosing between JSON and protobuf, it's chosing between "json+protobuf" and "json".
- bluGill 7y agoNot really. If you are sane you carefully parse all data from the internet and sanitize it first thing. json+protobuf is in fact an advantage because by keeping your internal and external data formats different you eliminate one class of mistakes where external data makes into internal systems. (this isn't perfect, you can change format without doing sanity checking but it makes it harder to do accidentally, and easier to find in an audit)
- gen220 7y agoIn addition to what my sibling comment says about "sanitizing" external data – which I wholeheartedly agree with – the "open API front-facing the internet" is in the process of changing, if you're talking about normal websites. gRPC-web isn't quite feature complete relative to normal gRPC, but it is getting pretty close, and the gains of avoiding JSON (de-)serialization would be big. I think once the protobuf story has a complete chapter for the front-end, bigger engineering orgs will roll it out much like they're rolling out typescript today. If you're talking about actual developer/public-facing APIs, those will probably remain in JSON land for a while.