When and why using Thrift would be a better solution than using simple socket / network programming?

I would like to use Thrift for the project, but I need many reasons why this would be better than just using simple sockets and structures sent over the network. Each argument that I tried to make always comes down to the fact that simple socket programming is easier and faster to implement for small applications. Obviously, to use or not to use it largely depends on the project, but in my case, in particular, this is a linux application in c / C ++ talking to a Windows service application (either C ++ or C #). I am trying to make a list of pros and cons (mostly pros) to use the savings instead of the simple send function through the socket. Here is the information that I have gathered about thrift so far (I admitthat some of them may be inaccurate or may require more clarification / clarification on my part) (I found a lot of this information onhttp://martin.kleppmann.com/2012/12/05/schema-evolution-in-avro-protocol-buffers-thrift.html ):

Another RPC and serialization option, Thrift consists of a library for handling distributed object / RPC communication and serialization and a compiler. Thrift is a free open source environment in accordance with Apache License 2.0, which allows the software user to freely use the software for any purpose, distribute it, modify and distribute modified versions of the software under license terms, excluding royalties. In addition, it can be combined with licensed GPL 3.0 content if the collaboration license is also GPL 3.0. Thrift is a fairly new structure that grew out of the RPC platform developed by Facebook and then released as an open source. It has existed since 2008 and has a thriving user community.

Thrift by default uses industry standard JSON or another built-in protocol to define data types and protocols; however, it also supports custom alternative interface description languages. Trrift libraries themselves can be compiled in several languages ​​(regardless of the platform), and the Thrift compiler can automatically generate classes, server, client and stub / skeleton code from interface / configuration files in several languages. Thrift has a server lock / unlock option to choose from. Limited network code must be written if Thrift is used because it is enabled. IDL files must be written to define packet data / commands for serialization / deserialization.

Thrift supports the following primitive types:

  • bool: Boolean (true or false)
  • byte: signed 8-bit integer
  • i16: 16-
  • i32: 32-
  • i64: 64-
  • double: 64-
  • string: , UTF-8

:

Thrift , (, /) . , / . / , . / , .

Thrift ( ), RPC - , , /, .

+4
2

, "". " ?", , , .

, 3GL +, 100- , 10k, .

, , , , . , ?

, : , ( , ) .

, , , , , , .

JSON? API Foobar? HTTP? MQ, ? , , , ? , , .

, , , , . , , , .

++/# Windows Linux: , Apache Thrift.

+1

, , . :

  • : , , (, ).
  • - . . , ..
  • , . , . , , .
  • 20 . , , . , (, ++ → java - ), ( ).

:

  • , goob protobuffers ( , 10%, TBinary TCompact).
  • , boost:: asio python. puprose.

- api, - . , , - . , . ( , ), boost:: asio, twisted sth, .

, .

+1

All Articles