trpc.group/trpc-go/trpc-go@v1.0.3/docs/user_guide/attachment.md (about)

     1  English | [中文](attachment.zh_CN.md)
     2  
     3  #  tRPC-Go Attachment (Large Binary Data) Transmission
     4  
     5  tRPC protocol now supports sending attachments over simple RPC.
     6  Attachments are binary data sent along with messages, and they will not be serialized and compressed by the framework.
     7  So the overhead the cost of serialization, deserialization, and related memory copy can be reduced.
     8  [code example](/examples/features/attachment).
     9  
    10  ## Alternative Solutions
    11  
    12  - Consider avoiding carrying large binary data in messages.
    13    For small binary data, the overhead of serialization, deserialization, and memory copy is not significant, and simple tRPC without attachment is sufficient.
    14  
    15  - Consider splitting large binary data using tRPC streaming, where binary data is divided into chunks and streamed over multiple messages.
    16    For more details, refer to the [example of streaming data](/examples/features/stream).
    17  
    18  - Consider using other protocols such as [streaming http](https://gist.github.com/CMCDragonkai/6bfade6431e9ffb7fe88).
    19    For more usage examples, refer to [client-server sending and receiving HTTP chunked](/http/README.md#client-and-server-sending-and-receiving-http-chunked).