important thing is that as per the age data importance decreases and after 1 month this data is not useful for analysis and kept for safety purpose only and after 180 days they never used and needs to be deleted.
Which of the following is best design for the data stored in DynamoDB table?
A. You will create a DynamoDB table, which can stored upto 1 Month data while keeping the read and write capacity for these tables very high.
B. After one month you can reduce the write capacity to 1 for that and read capacity as per the need.
C. Delete or archive the tables which are older than 180 days
D. You will be creating a single DynamoDB table for all the data. And increase the read and write capacity for that table.
E. You will be creating global index on single DynamoDB table based on the inserted timestamp.
F. You will be creating primary key index on single DynamoDB table based on the inserted timestamp.
1. A,B,C
2. C,D,E
3. D,E,F
4. A,B,E
5. A,C,F
Correct Answer : 1 Exp : : In this case data is not useful after 180 days. Then better approach either delete or archive that data. Hence, option-C is correct.
As age increases for the data they are not useful, then its better to create separate table for each time period. Here we can say 30 days is a good idea, because till 30 days this table will be used and after that
you can reduce the read/write capacity and create a new table for next 30 days. Hence option-A and B are correct. As per the AWS Documentation
Consider a typical time-series scenario, where you want to track a high volume of events. Your write access pattern is that all the events being recorded have todays date. Your read access pattern might be to read
todays events most frequently, yesterdays events much less frequently, and then older events very little at all. One way to handle this is by building the current date and time into the primary key.
The following design pattern often handles this kind of scenario effectively:
Create one table per period, provisioned with the required read and write capacity and the required indexes.
Before the end of each period, prebuild the table for the next period. Just as the current period ends, direct event traffic to the new table. You can assign names to these tables that specify the periods they have
recorded.
As soon as a table is no longer being written to, reduce its provisioned write capacity to a lower value (for example, 1 WCU) and provision whatever read capacity is appropriate. Reduce the provisioned read capacity
of earlier tables as they age. You may choose to archive or delete the tables whose contents will rarely or never be needed.
The idea is to allocate the required resources for the current period that will experience the highest volume of traffic and scale down provisioning for older tables that are not used actively, therefore saving costs.
Depending on your business needs, you may need to consider write sharding to distribute traffic evenly to the logical partition key.
1