gRPC Website Documentation

repository·main·Indexed 19 days ago

https://github.com/grpc/grpc.io

Source files and build instructions for the grpc.io website, built with Hugo and the Docsy theme. Includes guides on local development, build prerequisites using Node and NPM, and configuration for Google Analytics and Google Tag Manager.

Tokens
114.9K
Snippets
277
Records
485
Agent score
66%

What's inside grpc-grpc.io

  1. Overview of OpenTelemetry Metrics in gRPC

    main

    gRPC supports an OpenTelemetry plugin that provides metrics designed to help developers:

    • Troubleshoot system issues.
    • Iterate on and improve system performance.
    • Set up continuous monitoring and alerting.

    This plugin replaces the previously supported OpenCensus observability framework, which has been sunsetted in favor of OpenTelemetry.

  2. What is gRPC and its main usage scenarios

    main

    gRPC is a modern, open-source, high-performance Remote Procedure Call (RPC) framework designed to run in any environment. It is optimized for connecting services in and across data centers and is suitable for the 'last mile' of distributed computing (connecting mobile apps, browsers, and IoT devices to backend services).

    Main usage scenarios:

    • Microservices: Efficiently connecting polyglot services in microservices-style architectures.
    • Client-to-Backend: Connecting mobile devices and browser clients to backend services.
    • Library Generation: Automatically generating efficient client libraries.
  3. Supported gRPC authentication mechanisms

    main

    gRPC supports several built-in authentication mechanisms:

    • SSL/TLS: Used to authenticate the server and encrypt data. Supports mutual authentication (mTLS) where clients provide certificates.
    • ALTS (Application Layer Transport Security): A transport security mechanism available when running on Google Compute Engine or Google Kubernetes Engine (GKE).
    • Token-based authentication with Google: A mechanism to attach metadata-based credentials (like OAuth2 tokens) to requests.

    Important Security Note: Google credentials should only be used to connect to Google services. Sending a Google-issued OAuth2 token to a non-Google service risks token theft and impersonation.

    Token-based authentication must be used in conjunction with SSL/TLS, as most implementations require an encrypted channel to send credentials.

  4. Debug gRPC services with grpcdebug

    main

    The grpcdebug command-line tool is used to troubleshoot gRPC services by fetching their internal states via the gRPC protocol. It provides a human-friendly interface to browse data from gRPC admin services.

    Supported features include:

    • Channelz: Inspect statistics such as the number of RPCs sent or failed on a specific gRPC channel.
    • Health Checking: Monitor the health status of services.
    • CSDS (Admin Services): Inspect address resolution results and dump active xDS configurations used for RPC routing.
  5. Analyze gRPC messages using Wireshark

    main

    Wireshark is a network protocol analyzer that can decode gRPC messages transferred over the network. It uses two specific components for this: the gRPC dissector and the Protocol Buffers (Protobuf) dissector.

    Key Capabilities

    • Decoding Formats: Supports dissecting gRPC messages serialized in the Protocol Buffers wire format or as JSON.
    • RPC Types: Supports unary, server streaming, client streaming, and bidirectional streaming RPC calls.
    • Enhanced Dissection: Allows loading .proto files to provide meaningful decodings and supports registering custom subdissectors for byte or string fields.
  6. Find gRPC customer success stories

    main

    You can explore real-world applications and case studies of how organizations have adopted gRPC and other CNCF technologies. Key examples include:

    • Salesforce: Using gRPC for a unified interoperability strategy.
    • Mux: Utilizing cloud-native technology to simplify online video streaming.
    • Nulab: Boosting productivity using microservices and Kubernetes.

    For a comprehensive list of case studies involving CNCF technologies, visit the CNCF case studies page.

  7. Understand the gRPC-Rust development roadmap

    main

    The gRPC-Rust project is transitioning from a client-side preview to a more complete implementation. Key development areas include:

    Active Development (In Progress)

    Planned Features (Next Up)

    • Core gRPC Features: Retries, Binary Logging, Channelz Debugging, Keepalive support, and Authz (Authorization API).
    • xDS Support: Long-term focus on full xDS (Envoy) support, enabling Proxyless Service Mesh (PSM) use cases and direct connectivity for Google Cloud services.
    • Standardized Status Types: Moving toward a shared Rust RPC status type that aligns with the ergonomics of absl::Status and leverages the upcoming stabilization of the Rust Try trait.
    • Performance Tuning: Efforts to reduce memory usage (overall and per connection), implement zero-copy support, and develop a lower-level HTTP/2 implementation for higher throughput and lower latency.
  8. What is gRPC and why use it?

    main

    gRPC is a modern, open source remote procedure call (RPC) framework designed for transparent communication between client and server applications.

    Key use cases include:

    • Low latency, highly scalable, distributed systems.
    • Mobile clients communicating with cloud servers.
    • Designing new, efficient, and language-independent protocols.
    • Layered designs requiring extensions like authentication, load balancing, logging, and monitoring.

    Key advantages over raw HTTP/2 binary blobs: gRPC provides high-level features consistently across platforms, such as:

    • Application-layer flow-control interaction.
    • Cascading call-cancellation.
    • Load balancing and failover.
  9. What is gRPC-Web and how does it work

    main

    gRPC-Web is a JavaScript client library that allows web applications to communicate directly with gRPC backend services using Protocol Buffers.

    Unlike traditional REST architectures where a web app speaks HTTP to a REST API that then translates to gRPC, gRPC-Web enables an end-to-end gRPC pipeline. The client application speaks Protocol Buffers directly to a service proxy (like Envoy), which then communicates with the gRPC backend services. This eliminates the need for manual JSON serialization/deserialization and custom HTTP status code management.

  10. What is gRPC and how does it solve REST limitations?

    main

    gRPC is a high-performance, open-source universal remote procedure call (RPC) framework. It uses Google Protocol Buffers as its Interface Description Language (IDL) to describe service interfaces and message structures.

    Compared to traditional REST APIs, gRPC provides several advantages:

    • Declarative & Strongly-Typed: Uses a canonical IDL to define types, preventing issues with inconsistent field types or casing (e.g., recipientID vs Recipientid) across different clients.
    • Language Independence: The IDL is independent of programming languages, but can be compiled into language-specific stubs for C/C++, C#, Node.js, PHP, Ruby, Python, Go, Java, Objective-C, and Swift.
    • Automated Code Generation: Instead of hand-rolling RPC code, you use the protoc (protocol compiler) to generate client and server stubs, reducing errors and maintenance costs as you add new client types (like Android or iOS).
    • Compact Serialization: Uses Protocol Buffers, which are more compact than JSON because they do not include field names in the serialized form.
    • Extensible Tooling: The framework allows for custom protoc plugins to support new languages or specialized needs.
    • Contract Evolution: Supports forward and backward compatibility for message updates if basic rules are followed.
  11. What is gRPC Reflection and why use it?

    main

    gRPC Reflection is a protocol that allows a gRPC server to declare its exported protobuf-defined APIs over a standardized RPC service. This includes all types referenced by request and response messages.

    Benefits

    • Automated Tooling: Enables debugging tools like grpcurl and Postman to automatically discover services and types.
    • Human-Readable Interaction: Allows clients to encode requests and decode responses in a human-readable format without needing to manually provide .proto files.
    • Analogy: It is conceptually similar to serving an OpenAPI (Swagger) document for a REST API.