Reputation: 9522
I was just wondering whether it is useful to have shorter attribute keys in dynamodb. I know this has drawbacks since they are not human readable but thinking of millions of rows this means significant storage volume, at least in my mind.
So, does a shorter attribute key use less storage?
P.S. side question: how about the types. Can I always use strings or are there advantages of using e.g. numbers or booleans?
Upvotes: 1
Views: 57
Reputation: 47269
Yes, shorter attribute keys use less storage. From the documentation:
An item size is the sum of lengths of its attribute names and values (binary and UTF-8 lengths).
In terms of types, it is about how you want to model your data and what operations you want to perform on them. If you want to increment an attribute, you would want to use a Number
data type. If you want to store a blob of compressed image data you might use the Binary
data type. If you want a deleted
attribute on a row you would use the Boolean
data type. It also depends on if you have indexing requirements for any of these attributes.
Upvotes: 1