Frage

A UUID is, according to the specification, 128 bits or 16 bytes. The hexadecimal representation is 36 characters including the hyphens. I'm building a new table on DynamoDB and I have to decide the Type for the Hash key which I plan on filling with UUIDs. Should I create the table with a Hash key that is a String or Binary for these UUIDs? My gut tells me byte, because its less than half the size so that saves bandwidth, space, etc.

Does anybody have experience one way or the other and have a good reason to go with one over the other?

War es hilfreich?

Lösung

I personally prefer using as many String based attributes/keys as possible mainly because it is easier to debug those in the AWS DynamoDB console.

I also feel that binaries were added for compressed and raw binary data which IMO UUIDs are not.

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top