I\'m writing a simple logging service in DynamoDB.
I have a logs table that is keyed by a user_id hash and a timestamp (Unix epoch int) range.
When a user of
According to the DynamoDB documentation you could just delete the full table.
See below:
"Deleting an entire table is significantly more efficient than removing items one-by-one, which essentially doubles the write throughput as you do as many delete operations as put operations"
If you wish to delete only a subset of your data, then you could make separate tables for each month, year or similar. This way you could remove "last month" and keep the rest of your data intact.
This is how you delete a table in Java using the AWS SDK:
DeleteTableRequest deleteTableRequest = new DeleteTableRequest()
.withTableName(tableName);
DeleteTableResult result = client.deleteTable(deleteTableRequest);