title: Compression feature in java for cache system
body: <p>I am building a cache that has to store as much data as possible. CPU is not a mayor issue, because the next level of data is a lot more expessive to reach than running the CPUs a little bit for decompression.</p>
  
  <p>I'm looking for a good strategy and not a full implemenation. A typical object instance that should be cached can be gernalized as a list of hashmaps. The keys in these map are very similiar to keys in another map in that list. Keys and values are strings.</p>
  
  <p>Maps in different caching objects (this means also different lists) may not always have similar keys. Maybe only a subset (50%) of the keys is the same.</p>
  
  <p>I was thinking of extracting the keys into <strong>ONE</strong> header array and each collection of values of the hashmap into another array with the same length. This means the data array might be sparse (null-pointers). But I don't have to carry the meta data around. The possition in the data array is the only way of looking up the correct key. </p>
  
  <p>Now I want to compress the data array. Compression won't really work well on a single data array because there is little information. It will need a few data arrays stuck together to get a good compression rate.</p>
  
  <p>Is there any good way of compressing String-Arrays in java? How many of these data arrays should I cluster for good results?</p>
  
  <p>Is there maybe some better aporoach? This is a open questions for collecting ideas, so please feel free to elaborate :-)</p>