Approach #1: (Single item)
Single partition key, with all data included in the item, example:
PK: Item#1
object_attribute_1: full json item
object_attribute_2: full json item
object_attribute_3: full json item
object_attribute_4: full json item
Advantages I see: Less write costs, we write entire item at same time, so the round ups are more effective.
Disadvantages: Read costs might be bigger, because there is no option to filter, let's imagine I just need to query object_attribute_2 and not entire item.
Approach #2: (Multiple items)
Partition key + sort key combination, example:
Item#1:
PK: Object#1
SK: object_attribute_1_SK
object_attribute_1: full json item
Item#2:
PK: Object#1
SK: object_attribute_2_SK
object_attribute_2: full json item
Item#3:
PK: Object#1
SK: object_attribute_3_SK
object_attribute_3: full json item
Item#4:
PK: Object#1
SK: object_attribute_4_SK
object_attribute_4: full json item
Advantages I see: Can reduce read costs, in situation we only need specific thing, using SK, instead of returning entire object information, returns only what needed, less KB read
Disadvantages I see: Might increase write costs?
1 - It's 4 writes for single object (does the writes also depend in query transactions or only KB size?)
2 - If the full json item is less than 1KB, let's say 500b, is rounded up to 1kb , or 1.5kb rounded up to 2kb, etc
Which approach you advise me? I'm thinking well?
Thanks a lot