Building a gRPC Service in Golang: Bidirectional Streaming RPC (Tutorial)

Published: 27 May 2022
on channel: Mario Carrion
3,846
98

Welcome to this gRPC video using Golang, part of the series about API Technologies in System Design. In this episode I share with you how to implement a gPRC Service, specifically a Bidirectional Streaming RPC using Golang.

== gRPC: Bidirectional Streaming RPC?

Consists of a combination of the Client streaming RPC and Server streaming RPC, both streams are independent of each other, this means means the client and server can read and write messages to each other in any order. So in some cases the server could wait until all messages are received before replying back, or the could reply right away to each other sort of like a ping-pong game.

In practice to implement this we need 4 steps:

■ Implement the Service using gRPC via Protocol Buffers
■ Generate the code needed for the actual gRPC Streaming Bidirectional RPC (Server and Client)
■ Use the generated code to implement the gRPC Streaming Bidirectional RPC (Server)
■ Use the generated code to interact with the gRPC Streaming Bidirectional RPC (Client)

== Service kinds in gRPC

There are four kinds of service methods:

■ Unary RPC:    • Building a gRPC Service in Golang: Un...  
■ Server Streaming RPC:    • Building a gRPC Service in Golang: Se...  
■ Client Streaming RPC:    • Building a gRPC Service in Golang: Cl...  
■ Bidirectional Streaming RPC:    • Building a gRPC Service in Golang: Bi...  

== Relevant links

■ Tutorial: System Design using gRPC with Golang:    • Tutorial (Go/Golang): System Design u...  
■ Software Architecture and System Design in Go/Golang:    • Software Architecture and System Desi...  
■ Learning Golang: Interface Types - Part 1:    • Learning Golang: Interface Types - Pa...  
■ Learning Golang: Interface Types - Part 2:    • Learning Golang: Interface Types - Pa...  
■ Example code: https://github.com/MarioCarrion/grpc-...

== All Go/Golang Playlists

■ Building Microservices in Go/Golang:    • Building Microservices in Golang/Go  
■ Go/Golang Tools and Packages:    • Golang/Go Tools and Packages  
■ Learning Concurrency Patterns in Go/Golang:    • Learning Go/Golang Concurrency Patterns  
■ Learning Go/Golang :    • Learning Go/Golang  
■ Learning Relational Databases in Go/Golang:    • Learning Go/Golang: Relational Databases  
■ Testing in Go/Golang:    • Testing in Golang/Go  

== Connect with me!

■   / mariocarrion  
■   / mario.carrion  
■   / mariocarrion  

00:00 What is a gRPC Bidirectional Streaming RPC?
00:50 Implementing a gRPC Bidirectional Streaming RPC (Protocol Buffers)
03:44 Implementing a gRPC Bidirectional Streaming RPC (Server)
08:25 Implementing a gRPC Bidirectional Streaming RPC (Client)
11:49 Demo of a gRPC Bidirectional Streaming RPC
12:26 Conclusion about Building a gRPC Bidirectional Streaming RPC

=== Who am I?

Hello👋🏼! I'm Mario, a Hands-on Software Architect and Lead Backend Engineer with more than 16 years of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices.

Every week I will share with you different topics I've learned while working for small startups and large companies including the processes I've followed over the years for successfully delivering complex enterprise systems from start to end.

Subscribe if you like Software Development, Software Architecture and System Design!

Keep it up. Don't give up!

#golang #grpc #systemdesign

=== Our Vlog Channel

   / rubycarrion  

=== Affiliate links

■ Amazon Shop 🛒 https://www.amazon.com/shop/rubycarrion
■ Technical/Non-technical Books - Recommended by Mario Carrion 📚 https://www.amazon.com/shop/rubycarri...

DISCLAIMER: Some of the links shared above are affiliate links. As a member of these affiliate programs, I earn a small commission from your purchases at no additional cost to you. Thank you in advance for your support!


Watch video Building a gRPC Service in Golang: Bidirectional Streaming RPC (Tutorial) online without registration, duration hours minute second in high quality. This video was added by user Mario Carrion 27 May 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,84 once and liked it 9 people.