UUID data type in DynamoDB

五迷三道 提交于 2019-12-23 10:49:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/21888923/uuid-data-type-in-dynamodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!