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. Optionally, you can also select a more granular data type format for sample data generation.
-
If you want to add a sort key:
-
Select Add sort key.
-
Specify the sort key name and its type. Optionally, you can select a more granular data type format for sample data generation.
-
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 an attribute.
-
Specify the attribute name and its type. Optionally, you can select a more granular data type format for sample data generation.
-
-
Add a facet:
You can optionally add a facet. A facet is a virtual construct in NoSQL Workbench. It is not a functional construct in DynamoDB itself.
Note
Facets in NoSQL Workbench help you visualize an application's different data access patterns for Amazon DynamoDB with only a subset of the data in a table. To learn more about facets, see Viewing data access patterns.
To add a facet,
-
Select Add facets.
-
Choose Add facet.
-
Specify the following:
-
The Facet name.
-
A Partition key alias to help distinguish this facet view.
-
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 Inherit capacity settings from base table 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 DynamoDB throughput capacity.
-
Save the edits to your table settings..
For more information about the CreateTable
API operation, see CreateTable in the Amazon DynamoDB API Reference.