title: How to join tables in dynamoDB?
body: <p>I know DynamoDB doesn’t support joining tables, but here is my use case:</p>
  
  <p>(Using similar example to hide exact details, not posting a homework problem)</p>
  
  <p>I have four tables </p>
  
  <pre><code>Person ( unique_id(hash key), Name(range key), Age, Gender)&lt;br&gt;
  UIDtoSIDTable ( uid(hash key) , sid)&lt;br&gt;
  SIDtoStudentID(sid(hash key), studentID, other attributes)&lt;br&gt;
  StudentDetails(studentID(hash key), schoolName, Grades)
  </code></pre>
  
  <p>I am using dynamodbmapper.</p>
  
  <p>My application requires to display following data in a table:</p>
  
  <pre><code>unique_id, Name, Age (from Person table)
  sid 
  SchoolName, Grades (from studentDetails table)
  </code></pre>
  
  <p>Right now my implementation is:</p>
  
  <ol>
  <li>scan uidtosidTable for all uid-sid pair in a list say list1</li>
  <li>for each sid in list1, query for studentID from SIDtoStudentID table</li>
  <li>for each uid query from Person table, and for each studentID get data from StudentDetails Table</li>
  </ol>
  
  <p>Problem with this implementation is that it is taking very long to complete, over 5 minutes for 1000 items.</p>
  
  <p>If it was a relational database I would have joined the four tables, and got the required data.</p>
  
  <p>How to achieve this is dynamodb efficiently?</p>