我正在尝试为DynamoDB中的不同对象创建一个命名约定,例如表、分区和排序键、LSI、GSI、属性等。我阅读了很多文章,但没有通用的方法来做到这一点,但我想从实时示例中学习选择哪一个最适合我们的需求。
我正在研究的基础设施是基于微服务的。此外,我们的一些开发环境共享相同的AWS帐户。在此基础上,我得到了这样的结果:
Tables: [Environment].[Service Name].[Table Name].ddb-table
GSIs/LSIs: [Environment].[Service Name].[Table Name].[GSI/LSI Name].ddb-[gsi/lsi]
Partition Key: pk ??? (in my understanding, the keys should have abstract names, because the single table stores versatile data in the same key)
Sort Key: sk ??? (in my understanding, the keys should have abstract names, because the single table stores versatile data in the same key)
Attributes: meaningful but as short as possible as they are kept for every item in the tablecase
为单数形式。
下面是一个示例:
Table: dev.user-service.user-order.ddb-table
LSI: dev.user-service.user-order.lsi1pk.ddb-lsi
GSI: dev.user-service.user-order.gsi1pk.ddb-gsi你遵循什么命名规则?提前谢谢!
发布于 2022-07-27 23:16:16
我的建议是:
,所以它效率更高,延迟更短。
https://stackoverflow.com/questions/73145303
复制相似问题