The reference implementation of gRPC on github[0] has 998 open issues and 215 open pull requests. Every time I've tried to use this package I have encountered a previously-reported issue which has remained unfixed for months. If you need to interact with Google platform it's hard to avoid using gRPC, since many "official" libraries seem to be migrating towards this library, while it remains fragile and bug-ridden. My…
gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
61–70 of 139 posts
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#62I don't understand this, to be honest. What does type safety have to do with serialization formats or application protocols? I've used Servant (Haskell) to define the REST API for my backend, which gives me type safety, server stubs and generated client code for free. In my view, type safety is about what you internally use to represent your API, and has nothing at all to do with the underlying protocol(s). There's n…
> There's nothing about REST+JSON that prevents type safety, as far as I'm aware. Well, except for the fact that JSON is pretty much untyped? I don't understand what there is to not get. If you want type safe RPC you have to use an RPC system that at least has types ! What stops me sending `{ name: 12, age: "Hello"}` to your JSON RPC system?
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#63uh... your Web App teams took the day off and fed you shit.
you're all idiots.
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#64The reference implementation of gRPC on github[0] has 998 open issues and 215 open pull requests. Every time I've tried to use this package I have encountered a previously-reported issue which has remained unfixed for months. If you need to interact with Google platform it's hard to avoid using gRPC, since many "official" libraries seem to be migrating towards this library, while it remains fragile and bug-ridden. My…
"We later learned that Google’s gRPC Team was working on a gRPC-Web spec internally. Their approach was eerily similar to ours, and we decided to contribute our experiences to the upstream gRPC-Web spec (currently in early access mode, still subject to change)."
I suspect anyone attempting to adopt this implementation is going to hit similar issues until a release is finalized.
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#65Earlier quoted context omitted.
does graphql come with its own serialization protocol? I would have thought that the comparison of gRPC to GraphQL is apples/oranges.
GraphQL defaults to JSON over HTTP, but you can funnel it through sockets or protobuf or anything else. The conflict here is that gRPC goes beyond a serialization protocol - it's a full strongly typed RPC layer. You define your objects, methods, fields, types, relationships, data resolvers, execution pathways, etc. Just like GraphQL. I see no meaningful advantage in binary serialization - JSON is fast enough not to b…
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#66RPC has its own set of limitations, which if your application qualifies, might be a good fit: * Coupled server and client. gRPC uses protocol buffers which have zero backwards compatibility. * Zero discoverability. The client knows in advance what the server can do. * No standards to follow. You make up your own specs, like Google did. These constraints are orthogonal to REST, the architectural principles behind the…
I made a small mistake in the first point, got downvoted to oblivion and people seemed to stop reading there: the binary serialization indeed has backwards and forwards compatibility. However, the textual serialization lacks this compatibility. I can't remember a petty detail of a vendor specification apparently. Pedants with encyclopedic knowledge of Google are out in full force today! I should have stopped at "coup…
- For all of them you need to know the remote addresses (IP/hostname, port) upfront or use an external service discovery solution.
- For both you can implement some service introspection, which delivers you a list of available services/methods. Afaik for grpc there even exists some standardized introspection mechanism. For other HTTP APIs you might want to download some swagger description from a well-known address. Or WSDL scheme. Or GraphQL schema.
- Standards on which layer? On transport layer you are following the HTTP standard, independent of whether you are using grpc, GraphQL, json-rpc or some handmade REST API. On application layer you are mostly on your own anyway, there's not a lot things one could standardize. There are some exceptions, like the standardization of Webdav on top of HTTP, but most applications have their own specific set of requirements. If we are talking about standardization without meaning offical-standardization, then we can argue that grpc provides a more rigid (standardized) model for an application than the definition of some ad-hoc APIs: It is standardized how APIs and exchanged data types are defined (.proto files), how they can be accessed and how data is transferred over the wire (mapping to HTTP). All of that without the application developers on both sides needing to care for it.
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#67Everything old is new again, except tunnelled over HTTP.
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#68Earlier quoted context omitted.
does graphql come with its own serialization protocol? I would have thought that the comparison of gRPC to GraphQL is apples/oranges.
it uses json ? so you compare it to that
{ "query": "mutation Foo() { ... }" }
As such type safety is dependent on the query langauge (graphQL) not Json. As far as the Json goes, it might as well be multi-part form encoded.
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#69Earlier quoted context omitted.
> There's nothing about REST+JSON that prevents type safety, as far as I'm aware. Well, except for the fact that JSON is pretty much untyped? I don't understand what there is to not get. If you want type safe RPC you have to use an RPC system that at least has types ! What stops me sending `{ name: 12, age: "Hello"}` to your JSON RPC system?
> If you want type safe RPC you have to use an RPC system that at least has types! If you want a type safe RPC, you have to use proper RPC system in the first place. It doesn't matter if it is gRPC, SOAP, XML-RPC, JSON-RPC, or Apache Thrift. REST doesn't even define serialization format or error reporting. > you have to use an RPC system that at least has types! What stops me sending `{ name: 12, age: "Hello"}` to yo…
Re: gRPC-Web: Moving past REST+JSON towards type-safe Web APIs
#70Earlier quoted context omitted.
> There's nothing about REST+JSON that prevents type safety, as far as I'm aware. Well, except for the fact that JSON is pretty much untyped? I don't understand what there is to not get. If you want type safe RPC you have to use an RPC system that at least has types ! What stops me sending `{ name: 12, age: "Hello"}` to your JSON RPC system?
nothing stops you sending bad data to a gRPC endpoint either
They are talking about a work flow that prevents you from compiling bad clients. Of course if you don't use that workflow, you will still be able to make a bad client.