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



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

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

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 Server Streaming RPC using Golang.

== gRPC: Server Streaming RPC?

When building a Server streaming RPCs a client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are no more messages. gRPC guarantees message ordering within an individual RPC call.

In practice to do this there are 4 steps:

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

== Service kinds in gRPC

There are four kinds of service methods:

■ Unary RPC: https://youtu.be/GgR4JDVgPOc
■ Server Streaming RPC: https://youtu.be/l_74x_qQZB8
■ Client Streaming RPC: https://youtu.be/wKkaCxdfEh8
■ Bidirectional Streaming RPC: https://youtu.be/Z9SHd1K1k5Y

== Relevant links

■ Tutorial: System Design using gRPC with Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_EX1nv8fgltlm0CnJTH8Nwg
■ Software Architecture and System Design in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B-
■ Learning Golang: Interface Types – Part 1: https://youtu.be/xLf9oUfvvwo
■ Learning Golang: Interface Types – Part 2: https://youtu.be/m14ob5dCLag
■ Example code: https://github.com/MarioCarrion/grpc-microservice-example/tree/edee38ce37f13033af764a3120ad9079bcfb802c

== All Go/Golang Playlists

■ Building Microservices in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu
■ Go/Golang Tools and Packages: https://www.youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3
■ Learning Concurrency Patterns in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_Fhj_px_DzNzTsXs-mRwv1t
■ Learning Go/Golang : https://www.youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy
■ Learning Relational Databases in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_EgwoQTvNUflrYL_4qzdB7f
■ Testing in Go/Golang: https://www.youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq

== Connect with me!

■ https://twitter.com/MarioCarrion
■ https://www.instagram.com/mario.carrion
■ https://linkedin.com/in/MarioCarrion

00:00 What is a gRPC Server Streaming RPC?
00:44 Implementing a gRPC Server Streaming RPC
09:03 Implementing a gRPC Client Streaming RPC
14:16 Conclusion about Building a gRPC Service 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

https://www.youtube.com/c/RubyCarrion/videos

=== Affiliate links

■ Amazon Shop 🛒 https://www.amazon.com/shop/rubycarrion
■ Technical/Non-technical Books – Recommended by Mario Carrion 📚 https://www.amazon.com/shop/rubycarrion?listId=P8KAGIWTNH3X&ref=cm_sw_em_r_inf_list_own_rubycarrion_dp_dyqYP6yk67Hif

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!

Comments are closed.