All single-table examples · Open interactive viewer
How this model is organized
Reservations for hotels. This reference model by Rick Houlihan contains 5 entity types and 2 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.
- customer: type, PK, SK, __id.
PK:Provided by the itemSK:Provided by the item
- booking: type, PK, SK, startDate, endDate, rType, reservationId, assignment, state, GSI1PK, GSI1SK, __id.
PK:Provided by the itemSK:${GSI1SK}#${type}GSI1PK:Provided by the itemGSI1SK:Provided by the item
- hotel: type, PK, SK, details, __id.
PK:Provided by the itemSK:Provided by the item
- rate: type, PK, SK, startDate, endDate, amount, rType, rateId, __id.
PK:Provided by the itemSK:${startDate}#${type}
- summary: type, PK, SK, date, summary, __id.
PK:Provided by the itemSK:Provided by the item
Index keys
- primary: partition key
PK; sort keySK. - GSI1: partition key
GSI1PK; sort keyGSI1SK.
Example access patterns
These named queries are included in the model. Open the viewer to inspect their sample values and any filters.
- Get Customer: Query on
primary(Equal). - Get Customer's bookings: Query on
primary(Begins with). - Get Hotel's bookings in 2021: Query on
GSI1(Begins with). - Get Hotel: Query on
primary(Equal). - Get Hotel's rates: Query on
primary(Begins with). - Get Hotel's details in Sept 2021: Query on
primary(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.