[Python] Why protobuf is bad for large data structures?

Discussão em 'Python' iniciado por Stack, Agosto 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm new to protobuf. I need to serialize complex graph-like structure and share it between C++ and Python clients. I'm trying to apply protobuf because:

    • It is language agnostic, has generators both for C++ and Python
    • It is binary. I can't afford text formats because my data structure is quite large

    But Protobuf user guide says:


    Protocol Buffers are not designed to handle large messages. As a general rule of thumb, if you are dealing in messages larger than a megabyte each, it may be time to consider an alternate strategy.
    ​

    https://developers.google.com/protocol-buffers/docs/techniques#large-data

    I have graph-like structures that are sometimes up to 1 Gb in size, way above 1 Mb.

    Why protobuf is bad for serializing large datasets? What should I use instead?

    Continue reading...

Compartilhe esta Página