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框架

 

源起

注,240501T0828更新

看到下面这篇博文(bing.com 搜索 RPC 论文),才知道 RPC 的概念 始于 1974年。

那些年,我们追过的RPC - 果冻虾仁的文章 - 知乎
https://zhuanlan.zhihu.com/p/29028054

评论说是 科普文,挺好。

 

引用:

1974年冬,互联网大师 Jon Postel发表了RFC674:“Procedure Call Protocol Documents,Version 2”。

2008年,Google开源了Protocol Buffer(简称PB)

同年,Facebook向Apache贡献的Thrift正式开源。

2015年,Google将gRPC框架开源——富有创见性的使用了HTTP/2(双向流式通信(bidrectional streaming communication))。

文档链接:

https://www.rfc-editor.org/rfc/rfc674

 

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发布于博客园

 

posted @ 2024-04-29 23:23  快乐的二当家815  阅读(20)  评论(0编辑  收藏  举报