News for hackers. Stuff that matters.
Re:.NET Core gRPC by ToFab123 on Monday September 23, 2019 @09:13PM (#21055487)
Is this a replacement or a supplement/alternative to WCF?
Re:.NET Core gRPC by algorithmsRcool on Monday September 23, 2019 @10:49PM (#21056029)
Short answer is yes for most workloads. It's fast, scalable and well supported.

WCF could operate over pipes which was cool for machine local IPC, but beyond that I think gRPC is superior.

But I asked your exact question to the dotnet team and architect David Fowler gave me a decent answer.

> "I don't know that we have a definitive answer as yet and the GRPC experience while great isn't nearly as smooth (as of writing) as the WCF experience. I would say that it's definitely going to be one of the main RPC option of choice going forward but it;s a bit early to say that this is THE blessed new way."

https://github.com/dotnet/core/issues/2278

Re:.NET Core gRPC by efdee on Tuesday September 24, 2019 @07:35AM (#21058811)
This is always their answer - whether it's about .NET vs .NET Core, Winforms vs WPF, ADO.NET vs EF, Webforms vs MVC, or even language features like "var" (remember that originally they would tell you to avoid 'var' unless you're dealing with Linq).

"The new thing isn't immediately going to replace the old thing going forward" and then it does.

(And it should. I just don't get why they're always tiptoeing around that same point.)

Re:.NET Core gRPC by algorithmsRcool on Tuesday September 24, 2019 @09:26AM (#21059874)
Well in this case they have made clear that WCF isn't going to be supported officially in dotnet core.

They are just being non-committal about gRPC being the successor. But I have seen Fowler poking around in the RSocket codebase recently, so who knows.

Re:.NET Core gRPC by pjtr on Tuesday September 24, 2019 @02:32AM (#21057144)
Are there options for machine local IPC over pipes in .NET Core?
Re:.NET Core gRPC by avinium on Tuesday September 24, 2019 @04:22AM (#21057723)
Fairly limited, but anonymous pipes might fit your use case:

https://docs.microsoft.com/en-us/dotnet/standard/io/how-to-u...

Re:.NET Core gRPC by paulio on Tuesday September 24, 2019 @04:23AM (#21057725)
I might be the only person who liked WCF.
Re:.NET Core gRPC by flukus on Wednesday September 25, 2019 @03:25AM (#21068556)
I liked WCF, but .net devs insisting on using it to create pointless separate physical layers for web apps dulled my enthusiasm. Resume driven development in it's highest form.
Re:.NET Core gRPC by algorithmsRcool on Tuesday September 24, 2019 @10:24AM (#21060488)
I liked kinda liked it, but trying to unify HTTP, TCP, Pipes and MSMQ into a single framework was probably overly ambitious. WCF always felt very complicated with all sorts of sharp edges to me.
Re:.NET Core gRPC by WorldMaker on Tuesday September 24, 2019 @01:54PM (#21062843)
WCF also originally supported peer-to-peer network topologies, discovery methods like PNRP (Microsoft's competitor standard to eventual "winner" Bonjour/mDNS), various versions of the SOAP metadata formats, and WS-* standards, etc.

It was definitely ambitious. When it worked it was sometimes magic, and when it didn't it was a giant mess to resolve.

[ETA: In one past life I made the mistake of trying to use WCF Peer-to-Peer for a project and I still have scars from that. :O]

Re:.NET Core gRPC by paulio on Wednesday September 25, 2019 @08:48AM (#21070227)
It has a steep learning curve, true.

I personally like sharing `interface.cs` rather than what appears very similar `interface.proto` plus a bunch of tooling.

Ahh well, things go in circles I guess.

Re:.NET Core gRPC by fgonzag on Monday September 23, 2019 @09:34PM (#21055612)
This is grpc, Google's remote procedure call framework based on protobuffers. You don't really use it to expose public services, you mostly use it when you control both client and server endpoints, such as microservices.

You get type marshalling and other niceties with it that you don't get with REST, and it is much lighter and less complex than SOAP (on which WCF is based). Another decent alternative is json-rpc. Cross-platfofm compatibility is also miles better (ws-security and soap exceptions anybody?)

Re:.NET Core gRPC by manigandham on Tuesday September 24, 2019 @02:15AM (#21057057)
I highly recommend using it for public endpoints too. It's much nicer than worrying about a supported up-to-date client library in your language or using yet another variation of JSON/HTTP/REST that's unique to every API.

Some databases and queues are starting to use this now and it makes it incredibly easy to get started since we can generate our own clients and integrate at whatever level we need.

Re:.NET Core gRPC by xarope on Tuesday September 24, 2019 @03:09AM (#21057334)
I'm starting to steer our dev team towards this as well, would you have any good links to the gotchas involved in using grpc for public endpoints (if coming from REST as a legacy base)? e.g. for authentication and authorization, throttling etc? I looked at kong, but it seems the plugins don't apply to grpc.
Re:.NET Core gRPC by manigandham on Wednesday September 25, 2019 @05:08PM (#21075503)
Unfortunately no good reading I know of other than the official GRPC docs.
Re:.NET Core gRPC by mehrdada on Tuesday September 24, 2019 @12:14AM (#21056470)
> You don't really use it to expose public services

Why not? Google Cloud certainly does. Google Ads also exposes gRPC API. Google Assistant SDK is basically gRPC too. You get efficient typed client libraries in 10 or more languages for free. No reason not to consider it for public-facing endpoints.

Re:.NET Core gRPC by james_s_tayler on Tuesday September 24, 2019 @06:27AM (#21058388)
I haven't played with gRPC much but just trying to get my head around pros and cons and use cases...

I was under the impression that you can't specify fields as null. Instead they just get assigned whatever the default value is for that type.

That seems like a significant drawback for me if it is indeed the case. Especially in the case of a public facing API.

I like the idea of a lot of client libraries able to generate easily, I'm just not sure on this one point how to deal with it nicely...

Re:.NET Core gRPC by heavenlyblue on Tuesday September 24, 2019 @01:31PM (#21062572)
It’s so much better to express your opinion when you at least have read the docs of the technology you are discussing.
Re:.NET Core gRPC by james_s_tayler on Wednesday September 25, 2019 @03:15AM (#21068496)
"When a message is parsed, if it does not contain an optional element, the corresponding field in the parsed object is set to the default value for that field. The default value can be specified as part of the message description. For example, let's say you want to provide a default value of 10 for a SearchRequest's result_per_page value.

optional int32 result_per_page = 3 [default = 10];

If the default value is not specified for an optional element, a type-specific default value is used instead: for strings, the default value is the empty string. For bytes, the default value is the empty byte string. For bools, the default value is false. For numeric types, the default value is zero. For enums, the default value is the first value listed in the enum's type definition. This means care must be taken when adding a value to the beginning of an enum value list. See the Updating A Message Type section for guidelines on how to safely change definitions."

Well according to the docs on protocol buffers at least my understanding is as I have read elsewhere.

I don't know what your problem is guy.

Re:.NET Core gRPC by vmarsy on Tuesday September 24, 2019 @02:03AM (#21056987)
> You get type marshalling and other niceties

My favorite other nicety is forward and backwards compatibility. Having an older binary being able to easily handle the next version of the incoming proto, and also to not loose any of the not-yet-understood fields.

Short blog giving a concrete example: https://www.beautifulcode.co/blog/88-backward-and-forward-co...

Re:.NET Core gRPC by beauzero on Monday September 23, 2019 @09:46PM (#21055681)
You are correct WCF will not be an officially supported part of .net core. I believe an open source port has been started though. gRPC is meant to replace it. https://www.ben-morris.com/why-isnt-wcf-supported-in-net-cor...
Re:.NET Core gRPC by beauzero on Monday September 23, 2019 @09:49PM (#21055692)
Without going into a lot of detail. WCF and SOAP were good for http 1 and gRPC is optimized for 2.

Edit: spelling