Does Apache Thrift have any inherent data integrity checking? Does it guarantee that data is always delivered unaltered? I am sending large amounts of binary data over a Thrift service and I'm not sure if I need to implement any additional integrity verification, like MD5 checksum.
No, there is no such thing as a built-in error detection. That task is left to the developer and/or other parts of the communication stack.
The first question to ask would be if a simple CRC32 would be sufficient, or if you need stronger tools, like some SHA. The upper end would probably be a fully fledged crypto infrastructure to sign messages and verify the authenticity by means of asymmetric keys.
For each of these use cases there are good libraries available. As others correctly pointed out, if the transport relies on TCP and maybe even TLS/SSL that alone might be sufficient. It simply is not necessary to invent that wheel again. And, as outlined above, if really necessary the task can easily be delegated to a specialized, custom transport implementation as a "layered transport", similar to what TFramedTransport does.
The layers of Apache Thrift are explained here. It's a sensible assumption that errors could possibly happen only in Transport layer. If you are using TCP or HTTP (which is based on TCP) transport interfaces, data will be delivered unaltered, because that's how TCP works.
Note: I assume that you are not worried about security of your communication channel. If you do, neither TCP nor checksums will protect you from malicious data alteration. In such situation you need a secure communication tunnel like SSL/TLS. See: Thrift/SSL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With