title: How to save data to file in such a way that it is easy to access specific member of data without loading/parsing entire file?
body: <p>I have a struct filled with data in a tree data structure. Something like this in Rust:</p>
  <pre><code>struct MyData {
      // ...
      // Metadata
      nested_data: Vec&lt;MyNestedData&gt;
  }
  struct MyNestedData {
      // ...
      // MetaData
      nested_nested_data: Vec&lt;MyNestedNestedData&gt;
  }
  // ...etc...etc
  // And so it continues until lowest level.
  </code></pre>
  <p>I want to save this to a file, then read value of one single specific branch e.g.:</p>
  <p><code>mydata.nested_data[3].{...}.nested_nested_nested_nested_data[14].specific_data</code></p>
  <p>quickly without going through entire file, or loading this file to memory (RAM efficient).</p>
  <p>What is the best way to do this? What tools exist for this? Theory? Anything would be of help!</p>
  <p>Ideally data would be saved in a compact state (binary, but no compression for fastest read speed), and there would be no need to introduce database management system.</p>
  <p>I already have a system working with serialization/de-serialization, but it is slow since it de-serializes entire file and stores it to memory each time my program is called just to access one data member. And this program will be used as a module in another program that will send queries to it many times a second.</p>