title: Shelve is too slow for large dictionaries, what can I do to improve performance?
body: <p>I am storing a table using python and I need persistence.</p>
  
  <p>Essentially I am storing the table as a dictionary string to numbers. And the whole is stored with shelve</p>
  
  <pre><code>self.DB=shelve.open("%s%sMoleculeLibrary.shelve"%(directory,os.sep),writeback=True) 
  </code></pre>
  
  <p>I use <code>writeback</code> to <code>True</code> as I found the system tends to be unstable if I don't.</p>
  
  <p>After the computations the system needs to close the database, and store it back. Now the database (the table) is about 540MB, and it is taking ages. The time exploded after the table grew to about 500MB. But I need a much bigger table. In fact I need two of them.</p>
  
  <p>I am probably using the wrong form of persistence. What can I do to improve performance?</p>