News for hackers. Stuff that matters.
Re:Protobuffers Are Wrong (2018) by hot_gril on Thursday March 23, 2023 @07:34PM (#35283049)
> Protobuf is the worst serialization format and schema IDL, except for all the others.

I don't even feel this way. I can complain for days about most technical things, including things Google has made (e.g. Golang), but I've never had an issue with protobufs. They're just good. They don't totally replace JSON of course, but for the intended use case of internal distributed systems, they're solid.

Re:Protobuffers Are Wrong (2018) by elteto on Thursday March 23, 2023 @07:36PM (#35283063)
Or JSON backed by a protobuf schema for validation. Best of both worlds.
Re:Protobuffers Are Wrong (2018) by jchw on Thursday March 23, 2023 @07:41PM (#35283110)
It's also possible to use JSON directly with gRPC/DRPC/Connect, so you can take advantage of a Protobuf IDL and codegen with a bit less of the logistical complexity.
Re:Protobuffers Are Wrong (2018) by hot_gril on Thursday March 23, 2023 @07:37PM (#35283070)
Gets a little annoying cause of the translation between the two, but it's valid.
Re:Protobuffers Are Wrong (2018) by GauntletWizard on Thursday March 23, 2023 @07:50PM (#35283172)
JSON is good for dumps of your data, for humans reading it, and for interoperability without the schema - On your backends, you should always serialized to proto because it's darn more efficient.
Re:Protobuffers Are Wrong (2018) by elteto on Thursday March 23, 2023 @08:50PM (#35283644)
Always is such a strong word, always ;) Human readable is very important to me. If performance is not an issue I'd rather grep through it.
Re:Protobuffers Are Wrong (2018) by hot_gril on Thursday March 23, 2023 @08:53PM (#35283665)
If it's a startup or a personal project with no special performance requirements, chance of me using protobufs for anything is very slim. Human readability aside, just bothering to set up the serdes and other boilerplate is too low on my list of priorities. Makes more sense at medium scale.
Re:Protobuffers Are Wrong (2018) by lmm on Thursday March 23, 2023 @10:37PM (#35284375)
Slapping it all into gRPC is less boilerplate than whatever else you'd be doing (unless you're doing GraphQL or something). I'd always default to doing that (or thrift, honestly, but same difference) unless there were a particular reason to use something like a manual API.
Re:Protobuffers Are Wrong (2018) by hot_gril on Friday March 24, 2023 @02:36PM (#35293572)
gRPC requires HTTP/2, which is a nontrivial added requirement. Prevents it from running on Heroku and ironically Google AppEngine, and wherever it does work, load balancers will probably need special setup for it. Even Kubernetes. You can translate it to/from JSON, but that defeats the purpose.
Re:Protobuffers Are Wrong (2018) by hot_gril on Friday March 24, 2023 @05:16PM (#35295660)
Oh, gRPC over JSON still gives you the advantage of a well-defined API. But I use OpenAPI aka Swagger for that because it's a much thinner layer, especially if for whatever reason I need to handle HTTP GET (callbacks/webhooks) in addition to my typical HTTP POST JSON.
Re:Protobuffers Are Wrong (2018) by lmm on Saturday March 25, 2023 @06:37PM (#35308240)
> gRPC requires HTTP/2, which is a nontrivial added requirement. Prevents it from running on Heroku and ironically Google AppEngine

Then use thrift, which does plain http. But most of the design decisions in the article are the same there as well. Turns out there's really only one way to do this.

Re:Protobuffers Are Wrong (2018) by hot_gril on Monday March 27, 2023 @01:09PM (#35329292)
Yep, it's all basically the same thing, with small differences in performance and practicality.