gRPC: Up and Running: Building Cloud Native Applications with Go and Java for Docker and Kubernetes

Indrasiri, Kasun, Kuruppu, Danesh

買這商品的人也買了...

商品描述

Get a comprehensive understanding of gRPC fundamentals through real-world examples. With this practical guide, you'll learn how this high-performance interprocess communication protocol is capable of connecting polyglot services in microservices architecture, while providing a rich framework for defining service contracts and data types.

Complete with hands-on examples written in Go, Java, Node, and Python, this book also covers the essential techniques and best practices to use gRPC in production systems. Authors Kasun Indrasiri and Danesh Kuruppu discuss the importance of gRPC in the context of microservices development.

商品描述(中文翻譯)

透過實際案例,全面了解 gRPC 的基礎知識。這本實用指南將教導您如何使用這個高效的進程間通訊協議,在微服務架構中連接多語言服務,同時提供豐富的框架來定義服務契約和資料類型。

本書包含使用 Go、Java、Node 和 Python 撰寫的實際範例,並介紹在生產系統中使用 gRPC 的基本技術和最佳實踐。作者 Kasun Indrasiri 和 Danesh Kuruppu 討論了在微服務開發中使用 gRPC 的重要性。

作者簡介

Kasun Indrasiri is an author and an evangelist of Microservices and Enterprise Integration Architecture with over ten years of experience in building distributed systems. He is the director of Integration Architecture at WSO2 and the product manager of the WSO2 Enterprise Integrator. He has authored Microservices for Enterprise (Apress, 2018) and Beginning WSO2 ESB (Apress, 2017) books and has spoken at several conferences including O'Reilly Software Architecture Conference 2019 in San Jose, GOTO Con 2019 in Chicago, and WSO2 Conferences in San Francisco, London, and Barcelona. Kasun lives in San Jose, California and has founded the "Silicon Valley Microservices, APIs and Integration" Meetup, which is one of the largest microservices meetups in the San Francisco Bay area.

Danesh Kuruppu is an Associate Technical Lead at WSO2 and with over five years of experience in Enterprise Integration and Microservices technologies. Danesh is the main designer and developer of adding gRPC support for the open source, cloud native programming language, Ballerina. He is part of the gRPC community and a key contributor to the WSO2 Microservices Framework for Java and WSO2 Governance Registry.

作者簡介(中文翻譯)

Kasun Indrasiri是一位作者和微服務和企業整合架構的傳道者,擁有超過十年的分散式系統建構經驗。他是WSO2的整合架構總監,也是WSO2 Enterprise Integrator的產品經理。他撰寫了《企業微服務》(Apress,2018)和《開始使用WSO2 ESB》(Apress,2017)等書籍,並在多個會議上發表演講,包括2019年O'Reilly軟體架構大會(San Jose)、2019年GOTO Con(芝加哥)以及WSO2在舊金山、倫敦和巴塞羅那的會議。Kasun居住在加利福尼亞州聖荷西,並創辦了「矽谷微服務、API和整合」Meetup,該Meetup是舊金山灣區最大的微服務Meetup之一。

Danesh Kuruppu是WSO2的副技術主管,擁有超過五年的企業整合和微服務技術經驗。Danesh是開源、雲原生程式語言Ballerina的gRPC支援的主要設計師和開發者。他是gRPC社群的一員,也是WSO2 Microservices Framework for Java和WSO2 Governance Registry的重要貢獻者。

目錄大綱

Preface
Why Did We Write This Book?
Who Is This Book For?
How This Book Is Organized
Using Code Examples
Conventions Used in This Book
O’Reilly Online Learning
How to Contact Us
Acknowledgments


1. Introduction to gRPC
What Is gRPC?
Service Definition
gRPC Server
gRPC Client
Client–Server Message Flow
Evolution of Inter-Process Communication
Conventional RPC
SOAP
REST
Inception of gRPC
Why gRPC?
gRPC Versus Other Protocols: GraphQL and Thrift
gRPC in the Real World
Netflix
etcd
Dropbox
Summary

2. Getting Started with gRPC
Creating the Service Definition
Defining Messages
Defining Services
Implementation
Developing a Service
Developing a gRPC Client
Building and Running
Building a Go Server
Building a Go Client
Running a Go Server and Client
Building a Java Server
Building a Java Client
Running a Java Server and Client
Summary

3. gRPC Communication Patterns
Simple RPC (Unary RPC)
Server-Streaming RPC
Client-Streaming RPC
Bidirectional-Streaming RPC
Using gRPC for Microservices Communication
Summary

4. gRPC: Under the Hood
RPC Flow
Message Encoding Using Protocol Buffers
Encoding Techniques
Length-Prefixed Message Framing
gRPC over HTTP/2
Request Message
Response Message
Understanding the Message Flow in gRPC Communication Patterns
gRPC Implementation Architecture
Summary

5. gRPC: Beyond the Basics
Interceptors
Server-Side Interceptors
Client-Side Interceptors
Deadlines
Cancellation
Error Handling
Multiplexing
Metadata
Creating and Retrieving Metadata
Sending and Receiving Metadata: Client Side
Sending and Receiving Metadata: Server Side
Name Resolver
Load Balancing
Load-Balancer Proxy
Client-Side Load Balancing
Compression
Summary

6. Secured gRPC
Authenticating a gRPC Channel with TLS
Enabling a One-Way Secured Connection
Enabling an mTLS Secured Connection
Authenticating gRPC Calls
Using Basic Authentication
Using OAuth 2.0
Using JWT
Using Google Token-Based Authentication
Summary

7. Running gRPC in Production
Testing gRPC Applications
Testing a gRPC Server
Testing a gRPC Client
Load Testing
Continuous Integration
Deployment
Deploying on Docker
Deploying on Kubernetes
Observability
Metrics
Logs
Tracing
Debugging and Troubleshooting
Enabling Extra Logging
Summary

8. The gRPC Ecosystem
gRPC Gateway
HTTP/JSON Transcoding for gRPC
The gRPC Server Reflection Protocol
gRPC Middleware
Health Checking Protocol
gRPC Health Probe
Other Ecosystem Projects
Summary
Index

目錄大綱(中文翻譯)

前言
為什麼我們寫這本書?
這本書適合誰?
本書的組織方式
使用程式碼範例
本書使用的慣例
O'Reilly 在線學習
如何聯繫我們
致謝

1. gRPC 簡介
什麼是 gRPC?
服務定義
gRPC 伺服器
gRPC 客戶端
客戶端-伺服器訊息流程
進程間通訊的演進
傳統的 RPC
SOAP
REST
gRPC 的起源
為什麼選擇 gRPC?
gRPC 與其他協議的比較:GraphQL 和 Thrift
gRPC 在真實世界中的應用
Netflix
etcd
Dropbox
摘要

2. 開始使用 gRPC
建立服務定義
定義訊息
定義服務
實作
開發一個 gRPC 服務
開發一個 gRPC 客戶端
建置和執行
建置 Go 伺服器
建置 Go 客戶端
執行 Go 伺服器和客戶端
建置 Java 伺服器
建置 Java 客戶端
執行 Java 伺服器和客戶端
摘要

3. gRPC 通訊模式
簡單的 RPC(一對一的 RPC)
伺服器串流 RPC
客戶端串流 RPC
雙向串流 RPC
使用 gRPC 進行微服務通訊
摘要

4. gRPC:內部運作原理
RPC 流程
使用 Protocol Buffers 進行訊息編碼
編碼技術
長度前綴訊息框架
透過 HTTP/2 進行 gRPC
請求訊息
回應訊息
理解 gRPC 通訊模式中的訊息流程
gRPC 實作架構
摘要

5. gRPC:進階技巧
攔截器
伺服器端攔截器
客戶端攔截器
期限
取消
錯誤處理
多路徑
元資料
建立和擷取元資料
發送和接收元資料:客戶端端
發送和接收元資料:伺服器端
名稱解析器
負載平衡
負載平衡代理
客戶端負載平衡
壓縮
摘要

6. 安全的 gRPC
使用 TLS 驗證 gRPC 通道
啟用單向安全連線
啟用 mTLS 安全連線
驗證 gRPC 呼叫
使用基本身分驗證
使用 OAuth 2.0
使用 JWT
使用 Google 基於令牌的身分驗證
摘要

7. 在生產環境中運行 gRPC
測試 gRPC 應用程式
測試 gRPC 伺服器
測試 gRPC 客戶端
負載測試
持續整合
部署
在 Docker 上部署
在 Kubernetes 上部署
可觀察性
指標
日誌
追蹤
除錯和疑難排解
啟用額外的日誌記錄
摘要

8. gRPC 生態系統
gRPC 閘道
將 HTTP/JSON 轉換為 gRPC
gRPC 伺服器反射協定
gRPC 中介軟體
健康檢查協定
gRPC 健康探針
其他生態系統專案
摘要
索引