Hacker News new | ask | show | jobs
by FridgeSeal 892 days ago
> You can just take a glance at it and see any issues. With grpc/pbuf ... nope. not happening.

Sure, but on the other hand, the number of times I’ve needed to do this, compared to JSON/string/untyped/etc systems is precisely zero. There’s just a whole lot of failure that are just non-issues with typed setups like protobufs. Protobuf still has plenty of flaws and annoying-google-isms, but not being human readable isn’t one of them IMO.

2 comments

I haven’t worked with protobufs, but I’m old enough to know why people thought they needed protobufs (because hand writing terse wire protocols is painfully dumb).

Be careful about “need”. When people are avoiding doing something painful they invent all sorts of rationalizations to try to avoid cognitive dissonance. You don’t reach for to tool that hurts to pick up. You reach for something else, and most do it subconsciously.

Nobody is going to try to read protobuf data. Doesn’t mean they don’t need to understand why the wire protocol fucked up.

Nothing is preventing a system from sending you a un-deserializable message disguised as a protobuf, just like with any other encoding. In these cases, you need to diagnose the issue, no? Having something human-readable is simply straightforward.

If you haven't needed to do this, perhaps you aren't working on big enough systems? I've primarily needed to do this when dealing with hundreds of millions of disparate clients, not so much on smaller systems.

> Nothing is preventing a system from sending you a un-deserializable message disguised as a protobuf,

I guess it depends on where you come down on Postel’s law. If you’re an adherent, and are prepared to be flexible in what you accept, then yeah, you will have extra work on your hands.

Personally, I’m not a fan of Postels law, and I’m camp “send correct data, that deserializes and upholds invariants, or get your request rejected”. I’ve played enough games with systems that weren’t strict enough about their boundaries and it’s just not worth the pain.

When you have hundreds of millions of clients, there’s a good chance the client thinks it’s sending you the right data (especially when the customer says everything looks right on their end). You need to figure out if there is packet corruption (misbehaving switch), an outdated client, an egress load balancer screwing with packet contents, an office proxy trying to be smart, etc.

This requires looking at what is going over the wire in a lot of cases. It has nothing to do with Postel’s Law, but more to telling a customer what is wrong and making your own software more resilient in the face of the world.