I have a DynamoDB table and items in the table that look something like this:
{
"id":"id",
"randomData":{
"randomData1":"randomData1",
"randomData2":"randomData2"
},
"status":"status",
"subTasks":[
{
"subTaskId":"subTaskId",
"subTaskType":"subType",
"subTaskAnyData":"subTaskAnyData",
"subTaskStatus":"status",
},
{
"subTaskId":"subTaskId",
"subTaskType":"subType",
"subTaskAnyData":"subTaskAnyData",
"subTaskStatus":"status",
},
{
"subTaskId":"subTaskId",
"subTaskType":"subType",
"subTaskAnyData":"subTaskAnyData",
"subTaskStatus":"status",
}
]
}
So I have the top-level id (primary / partition key) attribute, but also inside the subTasks array, there is the subTaskId.
Is there an efficient way to query the table and get the data i.e. the one subTask object based on subTaskId?
Or should I consider redesigning the table and having the subtasks in a separate table?