Hacker Newsnew | past | comments | ask | show | jobs | submit | mf192's commentslogin

Taking this a bit further, it's surprising how many companies sell API as a service but provide minimal support for that API, publishing like 1 client/sdk (and often not in the language you need, lol).

Just mindblowing that companies don't adopt a schema-first approach to appeal to a broader customer base. I've lost count of the number of hnd rolled clients I've had to write over the years.

It gets even better if the API itself is backed by some RPC framework. With that, users can simply generate a client and get going.

It feels like we can do better as an industry, this cracked me up because it's so true.

"a single JSON example as the only documentation is... unfortunate"


Ye, fwiw there is an example code size comparison here:

https://github.com/bufbuild/connect-web/blob/main/packages/c...

I'm sure someone will chime in on the implementation details, but hopefully others can give it a try with their projects!


Curious, do you see connect-web falling into the former or the latter group?


You're right, gRPC-web isn't there and likely won't get there. That's why we need something like connect-web.

- no proxies - smaller bundle size - idiomatic TS code in both runtime and generated code - streaming - ... and more


Well that escalated quickly, nice article!


It always felt like gRPC was solving Google problems, heck that's (probably) what the g stands for.

Connect is for the rest of us. I wonder what kind of useful general-purpose interceptors folks will come up with?


As someone who’s done lots of RESTful (or RESTish) json/HTTP APIs, lots of gRPC, and lots of GraphQL … the simplest, best solution in almost all cases is RESTful json/HTTP APIs. There’s really no need for gRPC for the rest of us, it’s just unnecessary complexity.

If you want code gen, just edit OAS specs with Stoplight’s OpenAPI editor, and generate clients/servers with OpenAPI generator. If you really need event streaming between services, just use something like Google PubSub, webhooks, Kafka, whatever - external systems are better for this than direct server to server comms because they’re more reliable, far less worries about deployment, etc.

RPC seems simple at first but always balloons into excess complexity. Just stick with REST, and sprinkle in a PubSub system if absolutely necessary, it’ll stay simpler that way.


I don't see how Kafka means less worries about deployment


For event streaming, a shout out for redis's streams data type. A lot like Kafka for a lot less administrative overhead. Works in cluster mode, too.


gRPC streaming is too complicated so you should ... deploy Kafka?


I think the principle of using messaging is valid. You could just use a simple reliable MQTT broker.


gRPC is overkill for pretty much everything I do, but I like Protocol Buffers[0] for serialisation/deserialisation of big objects to disk.

[0] FlatBuffers would probably work well too, though I haven't used it


Only when "rest of us" === Go developers, in its current state.


Put out an example of using it to switch the transport so that it is over NATS instead, this works now thanks to the interop with net/http package: https://github.com/wallyqs/connect-go/commit/2e744ec4bf7ce31... Internally requests are treated as NATS requests so you would get similar performance and latency as when using core NATS request/response.


There's definitely a tipping point where having language independent interfaces/protobufs and definitions of services are basically mandatory for any cross-team collaboration or work to be possible. But yeah for small teams or single products it really might not be necessary or be total overkill early on in a new product.


No, the g in gRPC stands for gRPC.


It’s something new every release. Current is golazo, previous was gravity. https://github.com/grpc/grpc/releases

They use this to pad the release notes so they don’t have to comprehensively document the behavior changes.


> They use this to pad the release notes so they don’t have to comprehensively document the behavior changes.

I want to laugh, but I also want to cry because it's true.



I think another differentiator is support for streaming. Tbh I am shocked at the number of folks that use streaming, but alas.

It was the #3 issue opened on twirp repository, but they never settled on a solution.

https://github.com/twitchtv/twirp/issues/3

One super underrated feature Connect offers for Go devs is access to the request/response headers. No more plumbing incoming/outgoing context :phew:


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: