title: Caching huge data in Process memory
body: <p>I am working in Finance Industry. We want to roll out Database hit for data processing. It is very costly. So we are planning to go for on-demand cache logic. [ runtime insert &amp; runtime lookup ]</p>
  
  <p>Is anyone worked in implementation of Caching logic for more than 10 million of records?. Per record is say about 160 - 200 bytes.</p>
  
  <p>I faced following disadvantages with different approach.</p>
  
  <ol>
  <li>Can not use <strong>stl std::map</strong> to implement a key base cache registry.
  The insert and lookup is very slow after 200000 records. </li>
  <li><strong>Shared memory or memory mapped</strong> files are kind of overhead for caching data,
  because these data are not shared across the processes</li>
  <li>Use of <strong>sqlite3</strong> in-memory &amp; flatfile application database can be
  worth. But it too  have slow lookup after a 2-3 million of records. </li>
  <li>Process memory might have some limitation on its own kernel memory consumption. my 
  assumption is 2 gig on 32 bit machine &amp; 4 gig on 64 bit machine.</li>
  </ol>
  
  <p>Please suggest me something if you had come across this problem and solved by any means.</p>
  
  <p>Thanks</p>