什么是 RPC 框架和 Apache Thrift? [英] What is RPC framework and Apache Thrift?

查看:49
本文介绍了什么是 RPC 框架和 Apache Thrift?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为大学项目学习 Apache Thrift.正如这个教程所说,它是一个 RPC 框架,它是除了他们的文档之外,我唯一能找到的关于 Thrift 的文档.

I need to learn Apache Thrift for a University project. As this tutorial says, it is an RPC framework, and it was the only document I could find for Thrift other than their documentation.

谁能告诉我什么是 RPC 框架,它与 Apache Thrift 有什么关系?

Can someone tell me what is a RPC framework and how does this relate to Apache Thrift?

推荐答案

RPC 框架 通常是一组工具,使程序员能够在远程进程中调用一段代码,例如它在不同的机器上,或者只是同一台机器上的另一个进程.

An RPC framework in general is a set of tools that enable the programmer to call a piece of code in a remote process, be it on a different machine or just another process on the same machine.

Apache Thrift 的特殊情况下,我们讨论了一个高效的框架,并且可以跨操作系统平台和编程语言使用.此外,您在传输(如套接字、管道等)和协议(二进制、JSON,甚至压缩)方面具有一定的灵活性,以及​​更多选项,如 SSL 或 SASL 支持.

In the particular case of Apache Thrift, we talk about a framework designed to be efficient, and available across both OS platforms and programming languages. Additionally, you have some flexibility regarding transports (such as sockets, pipes, etc) and protocols (binary, JSON, even compressed), plus some more options like SSL or SASL support.

例如,您可以在 Linux 机器上设置一个用 C++ 编写的服务器,该服务器通过基于 HTTP 的基于 JSON 的协议向世界提供一些服务.该服务可以由在 Windows 机器上运行的用 Python 编写的客户端程序调用.服务器和客户端的代码都是从 Thrift IDL 文件生成的.要让它运行,您基本上只需要添加预期的程序逻辑并将所有部分放在一起.

For example, you may set up a server on a Linux machine, written in C++ which offers some service to the world through a JSON-based protocol over HTTP. This service may be called by a client program written in Python, running on a Windows machine. The code for both server and client is generated from a Thrift IDL file. To get it running, you basically have to add only the intended program logic and put all the pieces together.

Apache Thrift 的最佳参考仍然是 Apache Thrift 白皮书.尽管在某些细节上有些过时,但底层概念仍然有效.另一个不错的读物是 Diwaker Gupta 的失踪指南",最后同样重要的是Randy Abernethy 即将出版的书.

The single best reference for Apache Thrift is still the Apache Thrift Whitepaper. Although slightly outdated in some of the details, the underling concepts are still valid. Another good read is Diwaker Gupta's "Missing Guide", and last not least the forthcoming book from Randy Abernethy.

对于初学者,我建议从 Apache Thrift 教程套件开始,这些示例展示了很多核心功能.如果您遇到问题,欢迎您在 SO 上或在 Thrift 邮件列表上提问.

For beginners, I would recommend to start with the Apache Thrift tutorial suite, these examples show a lot of the core features. If you run into questions, you are welcome to ask here on SO, or on the Thrift mailing lists.

这篇关于什么是 RPC 框架和 Apache Thrift?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆