RPC協議有哪些

序章

什麼是 RPC?

答:RPC(Remote Procedure Call)遠程過程調用協議。

RPC 協議的用途是什麼?

答:服務間方便地調用,主要後端服務之間。看到一段話,【對外使用 RESTful API,對內使用 RPC】

使用RPC協議的好處?

答:相對於 RESTful API,(數據傳輸)效率更高(有多高?自己沒調查過)。

gRPC 是什麼?

答:Google 遠程過程調用(Google Remote Procedure Call,gRPC)。基於 HTTP 2.0 傳輸層協議承載的高性能開源RPC軟件框架。

 

在看 Dubbo 文檔看到了,本文 調查 目前有哪些 RPC 被廣泛使用

 

關鍵詞:

RPC協議、RPC框架

 

gRPC

Google 遠程過程調用(Google Remote Procedure Call,gRPC)。基於 HTTP 2.0 傳輸層協議承載的高性能開源RPC軟件框架。

gRPC提供了多種編程語言,如C、Java、golong、python等。——參考資料#2

官網:

https://grpc.io

A high performance, open source universal RPC framework.

 

Apache Dubbo

Apache Dubbo 是一款易用、高性能的 WEB 和 RPC 框架,同時爲構建企業級微服務提供服務發現、流量治理、可觀測、認證鑑權等能力、工具與最佳實踐。

官網:

https://cn.dubbo.apache.org

官文:

Dubbo 介紹

https://cn.dubbo.apache.org/zh-cn/overview/what/

性能的 RPC 通信
Dubbo 幫助解決微服務組件之間的通信問題,提供了基於 HTTP、HTTP/2、TCP 等的多種高性能通信協議實現,並支持序列化協議擴展,在實現上解決網絡連接管理、數據傳輸等基礎問題。

不是 gRPC 協議的替代品:Dubbo 支持基於 gRPC 作爲底層通信協議。

自 Dubbo3 開始,Dubbo 提供了 Java、Golang、Rust、Node.js 等多語言實現。

 

Apache Thrift

參考資料#3

thrift 是一種可伸縮的跨語言服務的 RPC軟件框架

2007年由facebook貢獻到apache基金,是apache下的頂級項目。

支持多語言:C、C++ 、C# 、D 、Delphi 、Erlang 、Go 、Haxe 、Haskell 、Java 、JavaScript、node.js 、OCaml 、Perl 、PHP 、Python 、Ruby 、SmallTalk。

 

官網:

https://thrift.apache.org

The Apache Thrift software framework, for scalable cross-language services development,

combines a software stack with a code generation engine to build services that work efficiently

and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript,

Node.js, Smalltalk, OCaml and Delphi and other languages.

 

Motan@GitHub

https://github.com/weibocom/motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Related projects in Motan ecosystem:

Motan-go is golang implementation.
Motan-PHP is PHP client can interactive with Motan server directly or through Motan-go agent.
Motan-openresty is a Lua(Luajit) implementation based on Openresty.

 

trpc@騰訊公司

github:

https://github.com/Tencent/trpc

官網:

https://trpc.group

A multi-language, pluggable, high performance RPC framework.

看到支持 C++、GOlang、Java:

tRPC Website: https://trpc.group/

tRPC Repo: https://github.com/trpc-group

tRPC-Cpp Repo: https://github.com/trpc-group/trpc-cpp

tRPC-Go Repo: https://github.com/trpc-group/trpc-go

tRPC-Java Repo: https://github.com/trpc-group/trpc-java

tRPC Plugin Ecosystem Repo: https://github.com/trpc-ecosystem

tRPC License: APACHE LICENSE, VERSION 2.0

 

小結

從自己的技術背景來看,學好 Dubbo、gRPC 就夠了。

Dubbo + Spring Cloud 開發。

gRPC + Golang + gin 開發。

 

---END---

 

本文鏈接:

https://www.cnblogs.com/luo630/p/18166790

ben發佈於博客園

參考資料

1、RPC是什麼,看完你就知道了 - Java發財的文章 - 知乎
https://zhuanlan.zhihu.com/p/187560185

發佈於 2020-08-17 21:38

2、什麼是gRPC?

https://info.support.huawei.com/info-finder/encyclopedia/zh/gRPC.html

3、RPC框架:從原理到選型,一文帶你搞懂RPC
發佈於 2022-06-13 18:33:23

作者:科控物聯

https://cloud.tencent.com/developer/article/2021745

4、分佈式 RPC 框架比較:dubbo、dubbox、motan、thrift、grpc

https://apifox.com/apiskills/comparison-of-rpc-frameworks/

廣告#用 Apifox,節省研發團隊的每一分鐘

5、

 

ben發佈於博客園

ben發佈於博客園

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章