Secrets behind cloud computing (8)-RPC framework

Source: Internet
Author: User

In the past client-server era, RPC framework layers such as CORBA and RMI were not expected, because such technologies can communicate the single-host IPC (inter-process communication) extended communication between multiple hosts is very helpful for scalability, but these RPC frameworks are not widely used in the industry for various reasons. In the cloud computing era, more and more machines need distributed communication. Although HTTP protocol can be used for simple communication, if the program can be conveniently used, if you have a very professional RPC framework, that would be even better. This article will introduce two of the most popular RPC frameworks: Google's protocol buffers and Facebook's thrift.

Protocol Buffers

Protocol buffers is Google's internal use of a language-neutral, platform-neutral, and scalable serialization of structured data, and provides implementation based on Java, C ++, and python, each implementation includes the compiler and library files of the corresponding language, and is used in many Google products. It is a binary format, so it is about 10 times faster than using XML for data exchange. It is mainly used in two aspects: one is normal RPC (Remote Procedure Call, remote method call) Communication, which can be used for communication between distributed applications or in heterogeneous environments; the second is data storage. Because of its self-description and convenient compression, it can be used for data persistence, such as storing log information, and can be processed by mapreduce programs.

Thrift

Thrift is an RPC framework open-source by Facebook. Now it has become one of the incubator projects of Apache, a famous open-source organization. Thrift has the following features: it supports many languages, including PHP commonly used in web development, C ++, Python, Java, and other languages frequently used in the Web backend, and even ruby and Erlang, which are popular recently; the second is to provide a complete RPC Framework implementation and generate communication-related framework code through scripts. For example, it takes only a few minutes to build a simple service, in this way, developers only need to focus on processing the business logic. The third is that they have been owned by Facebook and last. performance and availability verified by many large-scale Internet applications, such as FM. In general, its code implementation is excellent, its logic layer is very clear, and it is easy to customize and expand. At the same time, it is very convenient to generate code through the framework, and it also saves a lot of time for Communication Development and debugging, in addition, Facebook claims that thrift has a certain advantage over protocol buffers in terms of speed.

Both protocol buffers and thrift are excellent, but we still hope that you can choose based on the actual situation of the application. For example, when developing yuntable, due to performance and development costs, I did not select one of the two RPC frameworks, but built a simple binary communication framework, which is very easy to use and fast at the same time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.