title: How to store a key which has multiple values pair in Redis or Aerospike
body: <p>I have a usecase where  data transitions from one state to another.</p>
  
  <p>There are Four values which I can use. </p>
  
  <ol>
  <li>Order number - ( An order has multiple transitions)</li>
  <li>Current State</li>
  <li>Date of Transition</li>
  <li>Previous State.</li>
  </ol>
  
  <p>I need to store the data in such a way that the following condition</p>
  
  <ol>
  <li>Fetch all the transitions for a given order number</li>
  <li>From the data fetched, the order of transition should be understood.</li>
  </ol>
  
  <p>I thought of two ways to store it. </p>
  
  <pre><code>Map&lt;Integer, Map&lt;String, Date &gt; &gt;
  </code></pre>
  
  <p>Where Integer is the outer Key and Status is the inner key. Date is used for the getting the order of transition</p>
  
  <p>or</p>
  
  <pre><code>Map&lt;Integer, Map&lt;String, String &gt; &gt;
  </code></pre>
  
  <p>Where Integer is the outer Key and current Status is the inner key  and its value is previous status.</p>
  
  <p>Which would be a better implementation performance wise. Suggest a better implementation if possible.</p>
  
  <p>And I want to store this data in a distributed cache like redis or aerospike.</p>
  
  <p>Is there a way to store any of the above structures in them? 
  For my use case which would be better redis or aerospike ? Is any other better option available.</p>
  
  <p>Thank You. </p>
  
  <p>(I'm new to both aerospike and redis)</p>