This lab walks you through to create a table in Amazon DynamoDB and enable the TTL (Time To Live) feature. Next we will insert two values to the table, one with expiration time and the other with no expiration time and see whether the items in the table get deleted after the TTL gets expired.
You will practice the lab using DynamoDB Table.
Duration: 45 minutes
AWS Region: US East (N. Virginia) us-east-1
DynamoDB is a fast and flexible NoSQL database designed for applications that need consistent, single-digit millisecond latency at any scale.it is a fully managed database and it supports both document and key value data models.
It has a very flexible data model. This means that you don't need to define your database schema upfront. It also has reliable performance.
DynamoDB is a good fit for mobile gaming, ad-tech, IoT and many other applications.
DynamoDB tables consist of :
Items (Think of a row of data in a table).
Attributes (Think of a column of data in a table).
Supports key-value and document data structures.
Key= the name of the data. Value= the data itself.
Document can be written in JSON, HTML or XML.
Amazon DynamoDB Time to Live (TTL) allows you to define a per-item timestamp to determine when an item is no longer needed.
DynamoDB deletes the item from your table without consuming any write throughput.
TTL is provided at no extra cost.
TTL is useful if you store items that lose relevance after a specific time.
DynamoDB stores and retrieves data based on a Primary key
DynamoDB also uses Partition keys to determine the physical location of data being stored.
If you are using a partition key as your Primary key, then no items will have the same Partition key.
Composite Keys (Partition Key + Sort Key) can be used in combination.
Two items may have the same partition key, but must have a different sort key.
All items with the same partition key are stored together and then sorted according to the sort key value.
DynamoDB allows you to store multiple items with the same partition keys.
Before preceding this lab, please note that the DynamoDB TTL may take upto 48 Hours to delete the expired items from the table.
There is no guarantee that you will be able to see the actual deletion of an item but we can simulate the deletion from the dynamoDB console and see whether it will work or not.
Log into AWS Management Console.
Create a DynamoDB table.
Configure DynamoDB TTL.
Insert items into the table.
Test the lab configuration.
Validation of the lab.
Deleting AWS resources