Some questions after seeing the Grpc concepts...

58 views
Skip to first unread message

cod...@gmail.com

unread,
Mar 28, 2018, 9:35:47 PM3/28/18
to grpc.io
I've seen some GRPC presentations on Youtube and had some questions...

First as a background, https://www.youtube.com/watch?v=RoXT_Rkg8LA shows probably my overall understanding of the overall stack.

I'm interested in migrating a project I'm involved in that is currently built on top of REST/Swagger towards GRPC.

Here are the questions:
  • RXJS seems like a perfect library to build into this - specifically because it supports returning 1 or a stream of something. Would also handle the timeout case with RX's built in primitives too. How would one go about modifying a code generator (such as the Node/Browser code) to use RX? And/or is that easy? What language and build environment do I need to get involved in?
  • It mentions HTTP/2 as the transport protocol, which requires SSL, which can lead to issues when you don't have a signed cert. What are the steps to go through when you don't have a cert for localhost development?
  • If anyone has experience with Vert.x you may know about something called the Event Bus. The event bus lets you connect many peers that all add to the global pool of available microservices... is there anything equivalent to this in GRPC? For example if I have 10 git repos that each add 4 or 5 rpc services, can you connect to a service by ONE main URL or does each URL need to be configured separately? (is there a way to create a global even bus that the services live on?) Vert.x also provides round-robin features when the same service is deployed to multiple hosts.

Just to clarify not trying to pick on GRPC shortcomings or anything, I'm just coming in with my perspective so that others can pick it apart and either say - hey this is solved look here - or hey think about it this way instead.

Thanks!!!!

Benjamin Krämer

unread,
Mar 29, 2018, 3:07:07 AM3/29/18
to grpc.io
Hi, nice that you have a look at gRPC. I will answer your questions one by one.

  • RXJS seems like a perfect library to build into this - specifically because it supports returning 1 or a stream of something. Would also handle the timeout case with RX's built in primitives too. How would one go about modifying a code generator (such as the Node/Browser code) to use RX? And/or is that easy? What language and build environment do I need to get involved in?
 You would have to write a plugin for protoc in C. You can use any of the existing generators for whatever language you need as a template. Those are located here: https://github.com/grpc/grpc/tree/master/src/compiler
  • It mentions HTTP/2 as the transport protocol, which requires SSL, which can lead to issues when you don't have a signed cert. What are the steps to go through when you don't have a cert for localhost development?
You can either choose to disable TLS (grpc.credentials.createInsecure()) or you could create self-signed certs and use those. A good overview gives you the official documentation: https://grpc.io/docs/guides/auth.html#nodejs
If you need help on how to create self-signed certs, you can have a look at this example for C#. The cert creation process is the same: https://stackoverflow.com/a/37739265/3865064
Just use localhost for %COMPUTERNAME% and %CLIENT-COMPUTERNAME%.
  • If anyone has experience with Vert.x you may know about something called the Event Bus. The event bus lets you connect many peers that all add to the global pool of available microservices... is there anything equivalent to this in GRPC? For example if I have 10 git repos that each add 4 or 5 rpc services, can you connect to a service by ONE main URL or does each URL need to be configured separately? (is there a way to create a global even bus that the services live on?) Vert.x also provides round-robin features when the same service is deployed to multiple hosts.
 I'm sorry but I don't know about Vert.x, but I hope someone else could answer this question for you.

Josh Humphries

unread,
Mar 29, 2018, 10:03:34 AM3/29/18
to Benjamin Krämer, grpc.io
I am not familiar with Vert.X or its Event Bus, but from the way you describe it, I believe the answer is "yes". Services in gRPC are different from servers. A single server can expose many services. When you create a server, you register one or more services with it. That would be the way to contribute multiple "microservices" to the same server (at one URL). On the client, they are easily configured as one URL by creating a single client connection to that one server. Then you can create different stubs for each exposed service. Stubs wrap a client connection.

So a service is an interface (set of methods, defined in a proto file). And a client connection is logical connection to a server (logical because it could actually be multiple physical connections, like in a case where the service is load balanced across multiple backend replicas). The two are orthogonal.
 

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/3e95f225-0dc7-4a0b-b2fc-076c753ee85f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages