All single-table examples · Open interactive viewer
How this model is organized
Movies and their actors and directors. This reference model by Rafal Wilinski contains 3 entity types and 3 index definitions. Use the keys and access patterns below to understand how its records fit together before exploring the interactive viewer.
Entities and key templates
Each entity defines the attributes stored on its items. Key templates show how attribute values are combined; when no template is defined, the key value comes from the item itself.
- movie: type, pk, sk, year, budget, boxOffice, category, __id, gsi2pk, gsi2sk.
pk:Provided by the itemsk:Provided by the itemgsi2pk:${category}gsi2sk:${year}
- character: type, pk, sk, __id, role, playedBy, nationality, name, gsi1pk, gsi1sk.
pk:Provided by the itemsk:Provided by the itemgsi1pk:Provided by the itemgsi1sk:Provided by the item
- director: type, pk, sk, name, gsi1pk, gsi1sk, __id.
pk:Provided by the itemsk:Provided by the itemgsi1pk:${sk}gsi1sk:${pk}
Index keys
- primary: partition key
pk; sort keysk. - gsi1: partition key
gsi1pk; sort keygsi1sk. - gsi2: partition key
gsi2pk; sort keygsi2sk.
Example access patterns
These named queries are included in the model. Open the viewer to inspect their sample values and any filters.
- Die Hard Characters: Query on
primary(Begins with). - Movies by John McTiernan: Query on
gsi1(Begins with). - Get Die Hard 2 Director: Query on
primary(Begins with). - Action Movies before 1989: Query on
gsi2(Less than). - Movies where John McClane was a protagonist: Query on
gsi1(Begins with). - Details about Die Hard: Query on
primary(Equal). - All Action Movies: Query on
gsi2(Begins with).
Explore and adapt the example
Download the model JSON to inspect the full schema and sample records. Compare its access patterns with your application's requirements before adapting the design. For a guided editing workflow, see the single-table design tool.