Live data from Hacker News

gRPC-Go Engineering Practices

grpc.io

11–20 of 85 posts

Re: gRPC-Go Engineering Practices

#11
post #10

Is this gRPC the same thing as golang net/rpc referred to here: https://news.ycombinator.com/item?id=16170116 ? I don't think so but I've never used either one. >seniorsassycat: I don't understand why AWS released Go support instead of binary support and I don't understand why they chose to rely on go's net/rpc [...] which encodes objects using Go's special [gobs] binary format

No I believe gRPC is a different thing. Don't know what net/rpc is.

Re: gRPC-Go Engineering Practices

#12
post #3
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

Json is a serialization format. gRPC is both a serialization format and a DDL (data definition language). That means that you are storing your schema, which also happens to contain interoperability features. ...and the serialization format is more efficient.

gRPC uses protobuf, they are not synonymous.

Re: gRPC-Go Engineering Practices

#13
post #10

Is this gRPC the same thing as golang net/rpc referred to here: https://news.ycombinator.com/item?id=16170116 ? I don't think so but I've never used either one. >seniorsassycat: I don't understand why AWS released Go support instead of binary support and I don't understand why they chose to rely on go's net/rpc [...] which encodes objects using Go's special [gobs] binary format

net/RPC is a rpc implementation in the go standard library, which uses gob for serialization.

gRPC is a protocol and set of libraries for cross-language rpc based on protobuffs. Also doing a lot of codegen for you, like generating clients.

Re: gRPC-Go Engineering Practices

#14
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

I found gRPC to be a bit too heavyweight and complex. I'm pretty excited about twirp[1] right now.

[1]: https://github.com/twitchtv/twirp

Re: gRPC-Go Engineering Practices

#15
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

If you're doing microservices it's getting kinda boring to write all your client libraries, gRPC generates your client code, which saves time.

Re: gRPC-Go Engineering Practices

#16
post #12
post #3

Earlier quoted context omitted.

Json is a serialization format. gRPC is both a serialization format and a DDL (data definition language). That means that you are storing your schema, which also happens to contain interoperability features. ...and the serialization format is more efficient.

gRPC uses protobuf, they are not synonymous.

[deleted]

Re: gRPC-Go Engineering Practices

#17
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

Also streaming that you can't do with regular REST, so think about push notification and the like.

One of the biggest advantage imo is the contract between the client and the server, both are always in sync about what to send / receive.

I've seen many times things break because x,y,x added a field or change a type that the server / client couldn't understand.

Re: gRPC-Go Engineering Practices

#18
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

Afraid I'm going to be contrary and old-fashioned and say I prefer JSON. Its never been problematic adding or extending JSON endpoints and its never been a problem using basic gzip compression on the fly either. And JSON endpoints are a damn sight easier to debug and wireshark and all the rest. I've spent a lot of time writing fast JSON serialization for various languages including Java etc; its staggering how ineffi…

There are definitely cases for both. JSON is definitely easier to consume as a human (so for debugging).

gRPC was born out of Google's Stubby rpc system[0], which is used heavily for communicating between different jobs. If you are going to stand up a lot of different services that are going to talk, it provides a lot of advantages that you don't get with JSON. For large companies that use multiple program languages, this is really nice, as proto3 and GRPC have code generators for a slew of different languages.

There are a lot of other niceties that are useful in gRPC that you don't get with JSON (like streaming data).

[0] https://grpc.io/blog/principles

Re: gRPC-Go Engineering Practices

#19
post #17
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

Also streaming that you can't do with regular REST, so think about push notification and the like. One of the biggest advantage imo is the contract between the client and the server, both are always in sync about what to send / receive. I've seen many times things break because x,y,x added a field or change a type that the server / client couldn't understand.

> Also streaming that you can't do with regular REST

Nothing about the REST architectural style prohibits a resource (or, rather, a particular resource representation) from being a stream.

Re: gRPC-Go Engineering Practices

#20
post #3
post #2

Its a good time to ask, is gRPC any good? I'd love to standardize on stable middleware layer that handles multiple versions of clients and servers well. Rest with json really seems to work great for most things already. What is the advantage of gRPC - just more efficient?

Json is a serialization format. gRPC is both a serialization format and a DDL (data definition language). That means that you are storing your schema, which also happens to contain interoperability features. ...and the serialization format is more efficient.

It's actually protobuf which is both a serialization format and data definition language. gRPC is more of a service definition language in that sense.
Post reply on HN