Hi,
I have my own data structure written in C# (the structure is quite complex). I need to serialize and deserialize the structure. The size of the serialized file in disk can be pretty large at times (close to a 1 GB) but it can be small also (based on the number of records stored). I have the following requirements:
- The serialization and deserialization should be very fast
- I should be able to partially deserialize a large file (i.e. access only some relevant records), because if I deserialize the whole file from disk the memory usage will be too high.
- Should be thread-safe as multiple processes can write/read records from the file
I know it sounds like I need a database but I cannot use one for multiple reasons. I tried fulfiling requirement 1 by implementing ISerializable, which made it much faster than using the .net built in Binary/XML serializers, but not fast enough. For requirement 2 is completely stumping me.
Anybody out there got any ideas on how to go about this? I am thinking anybody who has had to save their own large file formats had to deal with similar issues.
Regards, Sam