UUID data type in DynamoDB

The UUID, according to the specification, is 128 bits or 16 bytes. Hexadecimal representation - 36 characters, including hyphens. I am creating a new table on DynamoDB and I have to decide what type is for the hash key that I plan to populate using the UUID. Should I create a table with a Hash key that is a String or Binary for these UUIDs? My gut tells me the byte, because it's less than half the size to save bandwidth, space, etc.

Does anyone have experience anyway and has a good reason to go with one over the other?

+3
source share
1 answer

I personally prefer to use as many String-based attributes / keys as possible, mainly because they are easier to debug in the AWS DynamoDB console.

I also believe that binaries were added for compressed and raw binary data that are not UOIDs.

From a pure performance view, you are probably right, but I would stick with the readable representations of the UUID String.

+5
source

All Articles