title: From relational database to Redis, N to N relation
body: <p>we are trying to move our database from MySQL. We are trying to understand how Redis work and we would like to know the best solution for this example.</p>
  
  <p><a href="https://i.stack.imgur.com/OtzqX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OtzqX.png" alt="enter image description here"></a></p>
  
  <p>How to solve Product->Categories relation?</p>
  
  <p>We will need
   - list of all products sorted by ID</p>
  
  <ul>
  <li><p>list of all products sorted by Name (ASC / DESC)</p></li>
  <li><p>list of all products in Category 1</p></li>
  <li><p>list of all products in Category 1 sorted by Name / ID / (ASC / DESC)</p></li>
  </ul>
  
  <p>From second part of image we will need to filter by Attributes</p>
  
  <ul>
  <li><p>list of all products with Attribute 1 (Attribute Value 1)</p></li>
  <li><p>list of all products with Attribute 1 (Attribute Value 1) in Category 1 sorted by Name</p></li>
  </ul>
  
  <p>Is it good to use Redis for this kind of data?</p>
  
  <p>Thanks</p>