DynamoDB M-M Adjacency List Design Pattern : <p>Referring to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-adjacency-graphs.html" rel="noreferrer">https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-adjacency-graphs.html</a>. I was wondering if anyone could help me.</p>

<p>The first image is of the table, and the second is the GSI. Here is the table:
<a href="https://i.stack.imgur.com/pA1n6.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/pA1n6.jpg" alt="enter image description here"></a></p>

<p>On the table, I don't understand how one is to create the sort-key? Is this one attribute that stores both Bill-ID and Invoice-ID? or two separate attributes? I have a feeling it's the one flexible attribute, and if so how do you differentiate one from the other? And how are we meant to construct the query on the sort-key?</p>

<p>Is it just by looking the prefix "Bill-" or "Invoice-"?
The practice of DynamoDB seems to make use of dashes ("-") to separate values in an attribute. If anyone can give me use cases of such things, I would be grateful as well, but I am going off tangent unless it's important in this case.</p>

<p>Now, this is very relatable and very interesting <a href="https://youtu.be/xV-As-sYKyg?t=1897" rel="noreferrer">https://youtu.be/xV-As-sYKyg?t=1897</a>, where the presenter uses ONE product table to store various types of items: Books, Song Albums, and Movies; and each has their own attributes.</p>

<p>Again I have a problem understanding the sort-key used there. I understand that productID=1 is bookID, and productID=2 is an Album. Now where it gets confusing now is what I circled in red. These are the tracks of Album 2. However, the structure of the sort key is "albumID:trackID". Now, where is the "trackID"? Is it meant to substitute the word "trackID" with actual ID? or is this meant to be a text exactly as "albumID:trackID"?.</p>

<p>What if I wanted to query a specific trackID? what would be the syntax of my query?</p>

<p>Please see the image here from the youtube:
<a href="https://i.stack.imgur.com/kXJmB.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/kXJmB.jpg" alt="enter image description here"></a></p>

<p>Thank you all in advance!!! :-)</p>
