gpt4 book ai didi

amazon-simpledb - SimpleDB 项目名称

转载 作者:行者123 更新时间:2023-12-01 03:59:56 26 4
gpt4 key购买 nike

我刚刚开始使用 Amazon SimpleDB(第一次使用 noSQL),在设置我的第一个用户域并添加第一个项目(带有属性 id 和 name)时,我想知道项目名称应该是什么?

  • 像 RDBMS id:“1”、“2”、“3”(所以我应该在某处计数)
  • Uuid
  • 更具可读性:“user_1”、“user_2”

  • 我会主要通过项目名称进行查询吗?在这种情况下,项目名称是否等同于 id,因此我不需要 id 属性?

    最佳答案

    Amazon SimpleDB 只需要数据库中每一行的唯一标识符。项目名称应该是唯一的,就像您在传统数据库中的 pk 一样。当您在 Amazon SimplDB 中查询任何数据时,您将获得项目列表作为命中。

    项目名称不是属性,但如果您计划将任何新域/表添加到 Amazon SimpleDB 并且您的任何属性将包含任何唯一数据,那么您可以将您的属性替换为项目名称。

    what should the item name be?



    这取决于您 - 您真正会保留什么作为项目名称。您可以保留您建议的所有三个数据,但它必须是传统数据库中的唯一数据,例如 pk。

    Will I be querying mostly by the item name? in this case is the item name equivalent to the id, therefore I don't need the id attribute?



    是的。您可以使用项目名称查询您的数据,例如 -
    select * from domain where itemName() = '1'

    关于amazon-simpledb - SimpleDB 项目名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14223261/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com