When designing DynamoDB databases for time series data, you can often best handle it by using one table per application per period.
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 today’s date.
- Build the current date and time into the primary key
- Create one table per period, provisioned with the required read and write capacity and the required indexes.
- Before the end of each period, build the table for the next period. Just as the current period ends, direct event traffic to the new table. Table names can 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 might choose to archive or delete the tables whose contents are rarely or never needed.