Cross-platform and language (de)serialization

后端 未结 7 1100
一个人的身影
一个人的身影 2021-02-07 22:13

I\'m looking for a way to serialize a bunch of C++ structs in the most convenient way so that the serialization is portable across C++ and Java (at a minimum) and across 32bit/6

7条回答
  •  终归单人心
    2021-02-07 22:24

    I'm surprised Jon Skeet hasn't already pounced on this one :-)

    Protocol Buffers is pretty much designed for this sort of scenario -- passing structured data cross-language.

    That said, if you're using a database the way you suggest, you really shouldn't be using a full-strength RDBMS like Oracle or SQL Server but rather a lightweight key-value store such as Berkeley DB or one of the many "cloud table" engines.

提交回复
热议问题