Biggest differences of Thrift vs Protocol Buffers?

前端 未结 15 1641
無奈伤痛
無奈伤痛 2020-11-30 15:59

What are the biggest pros and cons of Apache Thrift vs Google\'s Protocol Buffers?

15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 16:37

    There are some excellent points here and I'm going to add another one in case someones' path crosses here.

    Thrift gives you an option to choose between thrift-binary and thrift-compact (de)serializer, thrift-binary will have an excellent performance but bigger packet size, while thrift-compact will give you good compression but needs more processing power. This is handy because you can always switch between these two modes as easily as changing a line of code (heck, even make it configurable). So if you are not sure how much your application should be optimized for packet size or in processing power, thrift can be an interesting choice.

    PS: See this excellent benchmark project by thekvs which compares many serializers including thrift-binary, thrift-compact, and protobuf: https://github.com/thekvs/cpp-serializers

    PS: There is another serializer named YAS which gives this option too but it is schema-less see the link above.

提交回复
热议问题