gRPC - Google Remote Procedure Call ===================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is gRPC?** gRPC is a high-performance, open-source remote procedure call (RPC) framework developed by Google. It enables communication between services using HTTP/2 and Protocol Buffers (protobufs) for efficient, strongly-typed messaging. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is gRPC useful?** * Efficient communication – Uses Protocol Buffers for compact and fast serialization. * Strongly typed – Interfaces are defined using `.proto` files, enabling code generation. * Bi-directional streaming – Supports client, server, and bi-directional streaming natively. * Language interoperability – Works across many programming languages. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works?** * Define service – A `.proto` file defines the service and message types. * Generate code – Tools generate client and server code in multiple languages. * Client makes request – The client calls a method as if it were local. * Server handles request – The server receives the call and processes it. * Response sent – The result is sent back to the client over HTTP/2. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is gRPC used?** * Microservices – Enables efficient communication between services. * Mobile applications – Due to compact message size and HTTP/2. * Cloud services – Used in systems like Google Cloud and Kubernetes. * Real-time communication – Great for use cases needing bi-directional streaming. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI layer does this protocol belong to?** * gRPC defines application-level service interfaces and message formats. * It operates over transport protocols like HTTP/2, focusing on high-level logic. * It provides structured, reliable RPC services directly to applications. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`gRPC Version&RFC Details ` * :ref:`gRPC Basic Setup on Ubuntu using IPv4 ` * :ref:`gRPC Basic Setup on Ubuntu using IPv6 ` * :ref:`gRPC Protocol Packet Details ` * :ref:`gRPC Usecases ` * :ref:`gRPC Basic Features ` * :ref:`gRPC Feature : Protocol Buffers (Protobuf) ` * :ref:`gRPC Feature : HTTP/2 Transport ` * :ref:`gRPC Feature : Cross-Language Support ` * :ref:`gRPC Feature : Streaming Support ` * :ref:`gRPC Feature : Contract-First API Design ` * :ref:`gRPC Feature : Built-in Authentication ` * :ref:`gRPC Feature : Load Balancing & Retry ` * :ref:`gRPC Feature : Pluggable Architecture ` * :ref:`gRPC Feature : Efficient Binary Format ` * :ref:`gRPC Feature : Error Handling & Status Codes ` * :ref:`Reference links ` .. _gRPC_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _gRPC_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _gRPC_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _gRPC_step5: .. tab-set:: .. tab-item:: gRPC Version&RFC Details .. csv-table:: :file: ./gRPC/gRPC_rfcdetails.csv :widths: 10,10,10,30 :header-rows: 1 .. _gRPC_step19: .. tab-set:: .. tab-item:: gRPC Basic Setup on Ubuntu using IPv4 * setup .. _gRPC_step20: .. tab-set:: .. tab-item:: gRPC Basic Setup on Ubuntu using IPv6 * setup .. _gRPC_step6: .. tab-set:: .. tab-item:: gRPC Protocol Packet Details **Client Request Headers Packet** .. csv-table:: :file: ./gRPC/gRPC_packetdetails1.csv :widths: 10,20,30,10 :header-rows: 1 **gRPC Data Frame (Request Message) Packet** .. csv-table:: :file: ./gRPC/gRPC_packetdetails2.csv :widths: 10,20,30,10 :header-rows: 1 **Server Response Headers Packet** .. csv-table:: :file: ./gRPC/gRPC_packetdetails3.csv :widths: 10,20,30,10 :header-rows: 1 **gRPC Data Frame (Response Message) Packet** .. csv-table:: :file: ./gRPC/gRPC_packetdetails4.csv :widths: 10,20,30,10 :header-rows: 1 **Server Trailers Packet** .. csv-table:: :file: ./gRPC/gRPC_packetdetails5.csv :widths: 10,20,30,10 :header-rows: 1 .. _gRPC_step7: .. tab-set:: .. tab-item:: gRPC Usecases .. csv-table:: :file: ./gRPC/gRPC_usecases.csv :widths: 10,20,30 :header-rows: 1 .. _gRPC_step8: .. tab-set:: .. tab-item:: gRPC Basic Features .. csv-table:: :file: ./gRPC/gRPC_basicfeatures.csv :widths: 10,10,30 :header-rows: 1 .. _gRPC_step9: .. tab-set:: .. tab-item:: gRPC Feature : protocol buffers(Protobuf) **protocol buffers(Protobuf) - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature1_protocol_buffers_Protobuf_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step10: .. tab-set:: .. tab-item:: gRPC Feature : HTTP/2 Transport **HTTP/2 Transport - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature2_HTTP_2_Transport_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step11: .. tab-set:: .. tab-item:: gRPC Feature : Cross language support **Cross language support - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature3_Cross_language_support_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step12: .. tab-set:: .. tab-item:: gRPC Feature : streaming support **streaming support - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature4_streaming_support_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step13: .. tab-set:: .. tab-item:: gRPC Feature : Contract first API Design **Contract first API Design - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature5_contract_first_API_Design_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step14: .. tab-set:: .. tab-item:: gRPC Feature : Built in authentication **Built in authentication - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature6_Built_in_authentication_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step15: .. tab-set:: .. tab-item:: gRPC Feature : Load balancing Retry **Load balancing Retry - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature7_Load_balancing_Retry_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step16: .. tab-set:: .. tab-item:: gRPC Feature : Pluggable Architecture **Pluggable Architecture - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature8_Pluggable_Architecture_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step17: .. tab-set:: .. tab-item:: gRPC Feature : Efficient binary format **Efficient binary format - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature9_Efficient_binary_format_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step21: .. tab-set:: .. tab-item:: gRPC Feature : Error handling status codes **Error handling status codes - Testcases** .. csv-table:: :file: ./gRPC/gRPC_feature10_Error_handling_status_codes_testcases.csv :widths: 10,10,30,20 :header-rows: 1 .. _gRPC_step18: .. tab-set:: .. tab-item:: Reference links * Reference links