I need to store and fetch data to/from the database. The data is in a complicated format: It is stored in a Map object (the C++ standard library's Map), where each key is by itself a complicated object. I don't want to serialize down every key and every item of the Map because of performance considerations. On the other hand, I don't want to memcpy the Map into a binary buffer, since the application is supposed to be machine independent. Is there a half-way solution that assumes some knowledge about the Map and how the keys and the items are set in memory? Is there a different container that can be stored in an easier way?