Consider storing your data as a BLOB in SQLite DB. SQLite is extremely portable and heavy, ANSI C has both C ++ and Python interfaces. This will take care of large files, lack of fragmentation, variable length records with quick access, etc. The rest is just the serialization of structures for these BLOBs.
source
share