You will create 4 tables based on JSON format. For that, you will use the DynamoDBManager.create_table
method.
To make it easy to access the properties of each of the tables, create the dictionaries that have the following attributes:
table_name
: Name of the table, composed of a course prefix and the table name.kwargs
: Dictionary with additional arguments used in theDynamoDBManager.create_table
method.
Let's take a closer look at the attributes inside the kwargs
dictionary:
KeySchema
: Specifies the attributes that make up the primary key for a table or an index. The attributes inKeySchema
must also be defined in theAttributeDefinitions
array. This consists of one or more pairs of attribute names and key types:HASH
- partition key. The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.RANGE
- sort key. The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.- The Partition and Sort keys should be defined according to the patterns to access the data. If there is no Sort key, the Partition Key must be unique. If there is a Sort key, the combination of Partition and Sort keys must be unique.
AttributeDefinitions
: An array of attributes that describe the key schema for the table and indexes.ProvisionedThroughput
: The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.
You can take a look at the create_table
documentation.
Question: What is DynamoDBвЂ
?