Creating and writing to a NoSQL database called DynamoDB using AWS
We are going to look at creating a DynamoDB table, writing data to the table from hardcoded values, writing data records from a file, and then we are going to show two different ways to query a table:
Creating a DynamoDB in AWS
The following steps show how to create a DynamoDB:
- You need to sign in to the AWS Management Console first and then open the AWS DynamoDB console at https://console.aws.amazon.com/dynamodb/.
- Choose
Create table
or, in the DynamoDB navigation pane, chooseTables
and chooseCreate table
. - In the
Create DynamoDB Table
window, perform the following steps:- Under
Table name
, typeuser-visits
- In
Primary key
forPartition key
, typeEventId
and chooseString
- Check the
Add sort key
box - In
Sort Key
, typeEventDay
and chooseNumber
- Under
The partition key and hash key can be used interchangeably, like sort key and range keys. A primary key can be the partition key alone, or a composite key with both a partition key and a sort...