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
-
Open NoSQL Workbench, and in the navigation pane on the left side, choose the Data modeler icon.
-
Choose Create data model.
Create data model has two choices: Make model from scratch and Start from a template.
-
With the model created, choose Add table.
For more information about tables, see Working with tables in DynamoDB.
-
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:
-
Select Add sort key.
-
Specify the sort key name and its type.
-
Note To learn more about primary key design, designing and using partition keys effectively, and using sort keys, see the following:
-
-
To add other attributes, do the following for each attribute:
-
Choose Add other attribute.
-
Specify the attribute name and type.
-
-
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.
-
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.
Repeat this step if you want to add more facets.
-
-
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.
For more information about working with global secondary indexes in DynamoDB, see Global secondary indexes.
-
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.
Select your desired capacity mode, read and write capacity, and auto scaling IAM role (if applicable).
For more information about DynamoDB capacity settings, see Read/write capacity mode.
-
Choose Add table definition.
For more information about the CreateTable
API operation, see CreateTable in the Amazon DynamoDB API Reference.