Search code examples
gokubernetesmicroservicesprotocol-buffersgrpc

gRPC based microservice architecture for inter-service communication


I am trying to comprehend how does the inter-service communication works when implementing these services using gRPC. While there are lot of articles out there covering the basics about getting started with gRPC and how it can be compiled to multiple different languages. I am still kind of missing some guidelines on how best should each service in microservice architecture communicate.

My general understanding, after following through something like this : https://www.oreilly.com/library/view/practical-grpc/9781939902580/

That if I need to use gRPC in microservice architecture where inter-service communication will be gRPC based each service will essentially (and as needed) should do server and client stub implementation to talk to other services.

So for me it would look something like this enter image description here

And if above is the case, then getting each of these services deployed in K8s environment seems like quite some effort esp. with making each service discoverable in the entire cluster.

Some additional notes I am developing with Go primarily and using protobuf for defining proto files.

It'll be greatly helpful if someone could comment on this or has a resource that I can go through to better my understanding.

Thanks!


Solution

  • Your understanding is correct. If you want to have separate services that talk to each other remotely in kubernetes, you will have to deploy them (helm could help here) and you have to create services for cluster discovery.