DynamoDB is a key-value-based NoSQL store service for high scalability. The AWS proposed schema is shown in the following section (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-time-series.html):
Primary key | Sort key | Data | |
Day | Time | Sensor1 value | Sensor2 value |
... | ... | ... |
The primary key is the date (date of the day without time), while time is used for the sort key. Every column is an attribute. AWS also suggests partitioning the table to ingest 10 GB of data in each partition.
To create a DynamoDB table, follow these steps:
- Click on DynamoDB from the AWS console and then click on the Create table button
- Enter the name as current_signals, the primary and partition key as ts_date, and the sort key as ts_time, as shown in the following screenshot:
Creating a table with DynamoDB
- Finally, we can click on the Create button to set up our table in DynamoDB
We now need to connect our IoT Core to the DynamoDB.