introduction gRPC

An RPC Workflow

RPC is easy to understand . A basic RPC process can be broadly separated into five stages: “origination,” “marshaling,” “broadcast,” “reception,” “processing,” and “response.”

  • Origination: In this stage, the client calls what is known as a “Client Stub.” This stub is a local procedure or subroutine process that is called as a normal, local process. Once this process has been called, it moves to the second step of this stage, known as “marshaling.”
  • Marshaling: The Client Stub, having been passed a set of parameters, packs the call and parameters and issues a system call to send the message.
  • Broadcast: With the packaged set of call and parameters, the local operating system sends the packaged message from the client to the server.
  • Reception: The package of the call and parameters is received by the server from the client. These packets of data are assembled and passed to what is called the “Server Stub.” This stub functions just as the Client Stub.
  • Processing: Now that the server stub has received the data packet, it is unpacked in a process called “unmarshaling.” The call is extracted along with the parameters, and is then considered a local process or subroutine.
  • Response: The server calls the local unpacked process or subroutine. The results are then sent back in the opposite fashion, moving from Response to Processing and so on until it is delivered to the Origination stage client.
  •  

Why RPC?

Protobufs and Compiling

Idiomatic and Open Source

Efficient and Scalable

HTTP/2 enables bi-directional streaming in its transport specification

Baked In Authentication Support and Solutions

 

the elements of gRPC:

Protocol Buffer

Protocol buffer is a form of Interface Definition Language for structured data serialization and de-serialization between two parties. They are transmitted over a network in binary forms.

 

09112017_mwRH.png

HTTP/2

Hypertext Transfer Protocol Version 2 (HTTP/2) is defined by RFC 7540 provide better performance for HTTP traffic with bi-directional streaming and flow control on a single TCP connection. This website demonstrates the performance difference between HTTP and HTTP/2.

 

 

09112023_E1P2.png

 

Multi-language Support

gRPC has a command line compiler to generate stubs and code in different languages that can be used for the gRPC client and server. This feature facilitates gRPC to get up and running rapidly.

 

 

09112026_6znq.png

 

转载于:https://my.oschina.net/shannanzi/blog/1587192

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值