title: Cache data structure design
body: <p>To explain the domain...</p>
  
  <p>I have a bunch (1,000,000) of items, each of a particular type of 12 possible types (TypeA, TypeB ... TypeK)
  There are 3 immutable classes viz. ItemKey (to uniquely id the item), ItemTypeKey (to uniquely id the type) and ItemType (containing the type data including the ItemTypeKey)</p>
  
  <p>I have in front of me a cache that stores this data in two data structures ...</p>
  
  <pre><code>ConcurrentHashMap&lt;ItemKey, ItemTypeKey&gt;
  ConcurrentHashMap&lt;ItemTypeKey, ItemType&gt;
  </code></pre>
  
  <p>I would have implemented it simply as a <code>ConcurrentHashMap&lt;ItemKey, ItemType&gt;</code> 
  The memory footprint would be minimial in this case too as the cache is only storing references anyway. </p>
  
  <p>Is there any particular advantage to splitting the cache that I am not seeing?
  Any alternative data-structure designs too are welcome</p>