This use case reminds me of what we ended up doing at Twilio to offload our protobuf records for Voice Insights from Kafka to Parquet on HDFS for historic replay.
We essentially ended up serializing the raw DataFrame from Apache Spark's Kafka connector (this was early days of Structured Streaming - around Spark 2.3 days) and kept the original Kafka payload bytes for our CallSummarizer (produced call detail records (CDRs)). We used the struct<timestamp:uint64,key:byte[], payload:byte[], topic:string, version:uint32, format:string[protobuf], serde:string> the serde was for a Java class and we had a custom ExpressionEncoder since protobuf wasn't a first class citizen in Spark at the time. There was a good amount of overhead to store the serde=`com.twilio.voice.insights.Call` fields across millions of events a minute - and I'd see the same overhead if you pack the protobuf's FileDescriptorSet or a reference to where that lives in a registry (buf schema registry, confluent schema registry, etc) With all of this said, having support to efficiently store the protobuf (or serde) metadata would have helped us lay out these historic records better. -- *Scott Haines* OSS Engineer E: 408.768.3799 LI: https://www.linkedin.com/in/scotthaines/
