Creating a new data model - Amazon DynamoDB
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

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.

    Create data model has two choices: Make model from scratch and Start from a template.

    
                    Console screenshot showing the Create data model screen.
    Make model from scratch

    To make a model from scratch, enter a name, author, and description for the data model. Choose Create when finished.

    
                                Console screenshot showing create model from scratch
    Start from a template

    Starting from a template lets you choose a sample model to start from. Choose More templates to see more template options. Choose Select for the template that you want to use.

    Enter a data model name, author, and description for the template you selected. You can choose between Schema only and Schema with sample data.

    • Schema only creates an empty data model with the primary key (partition and sort key) and other attributes.

    • Schema with sample data will create a data model complete with sample data for the primary key (partition and sort key) and other attributes.

    When this information is complete, choose Create to create the model.

    
                                Console screenshot showing create model from template
  3. With the model created, choose Add table.

    
                    Console screenshot showing the add table button.

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

  4. 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 check box.
    Note

    To learn more about primary key design, designing and using partition keys effectively, and using sort keys, see the following:

  5. 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.
  6. Add a facet:

    Note

    Facets represent an application's different data access patterns for DynamoDB. To learn more about facets, see Viewing data access patterns.

    • 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 this step if you want to add more facets.

  7. 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.

  8. 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, clear 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.

  9. 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.