Creating a New Data Model - Amazon DynamoDB

Creating a New Data Model

Follow these steps to create a new data model in Amazon DynamoDB using NoSQL Workbench.

To create a new data model

  1. Open NoSQL Workbench, and in the navigation pane on the left side, choose the Data modeler icon.

    
                        Console screenshot showing the data modeler icon in
                            DynamoDB.
  2. Choose Create data model.

    
                                Console screenshot showing the Create data model button.
  3. Enter a name, author and description for the data model, and then choose Create.

  4. Choose Add table.

    
                                Console screenshot showing the add table button.

    For more information about tables, see Working with Tables in DynamoDB.

  5. Specify the following:

    • Table name — Enter a unique name for the table.

    • Partition key — Enter a partition key name and specify its type.

    • If you want to add a sort key:

      1. Select Add sort key.

      2. Specify the sort key name and its type.

    
                        Console screenshot showing the table name and partition key boxes
                            and the add sort key checkbox.
  6. To add other attributes, do the following for each attribute:

    1. Choose Add other attribute.

    2. Specify the attribute name and type.

    
                        Console screenshot showing the add other attribute button.
  7. Add a facet:

    Note

    Facets represent an application's different data access patterns for DynamoDB.

    • Select Add facets.

    • Choose Add facet.

      
                                Console screenshot showing the add facets button and the add
                                    facet button.
    • Specify the following:

      • The Facet name.

      • A Partition key alias.

      • A Sort key alias.

      • Choose the Other attributes that are part of this facet.

    Choose Add facet.

    
                        Console screenshot showing the facet details and the add facet
                            button.

    Repeat step 8 if you want to add more facets.

  8. If you want to add a global secondary index, choose Add global secondary index.

    Specify the Global secondary index name, Partition key attribute, and Projection type.

    
                        Console screenshot showing the add GSI button.

    For more information about working with global secondary indexes in DynamoDB, see Global Secondary Indexes.

  9. By default, your table will use provisioned capacity mode with auto scaling enabled on both read and write capacity. If you want to change these settings, uncheck "Default settings" under Capacity settings.

    
                    Console screenshot showing the Capacity settings heading with
                        "Default settings" selected.

    Select your desired capacity mode, read and write capacity, and auto scaling IAM role (if applicable).

    
                    Console screenshot showing the table capacity settings

    For more information about DynamoDB capacity settings, see Read/Write Capacity Mode.

  10. Choose Add table definition.

    
                        Console screenshot showing the add table definition button.

For more information about the CreateTable API operation, see CreateTable in the Amazon DynamoDB API Reference.