【问题标题】:Apigee Usergrid: Which data structure amongst the two here is better?Apigee Usergrid:这两种数据结构中哪个更好?
【发布时间】:2015-08-05 17:43:26
【问题描述】:

我正在使用内部用户 Cassandra 的 Apigee Usergrid。在存储数据时,我遇到了以下困境。

我是否像这样存储数据:

[{
"portlet": "personal_information",
"fields": [{
    "id": "first_name",

    "text": {
        "en_us": "First Name",
        "de_de": "First Name"
    }
}, {
    "id": "salutation",

    "text": {
        "en_us": "Salutation",
        "de_de": "Salutation"
    }
}, {
    "id": "marital_status",

    "text": {
        "en_us": "Marital Status",
        "de_de": "Marital Status"
    }
}, {
    "id": "native_preferred_lang",
    "text": {
        "en_us": "Preferred Lang",
        "de_de": "Preferred Lang"
    }
}]

}]

或者这个

    [{
        "id": "first_name",
        "portlet": "personal_information",
        "text": {
            "en_us": "First Name",
            "de_de": "First Name"
        }
    }, {
        "id": "salutation",
        "portlet": "personal_information",
        "text": {
            "en_us": "Salutation",
            "de_de": "Salutation"
        }
    }, {
        "id": "marital_status",
        "portlet": "personal_information",
        "text": {
            "en_us": "Marital Status",
            "de_de": "Marital Status"
        }
    }, {
        "id": "native_preferred_lang",
        "portlet": "personal_information",
        "text": {
            "en_us": "Preferred Lang",
            "de_de": "Preferred Lang"
        }
         }]

这可能与所有 no-sql 数据库有关。什么数据格式更有效?

【问题讨论】:

  • 对于 Cassandra,“高效”取决于您的查询模式。您是否要向用户查询特定主题,例如婚姻状况、名字或称呼?还是只是去查询用户的个人信息,在客户端梳理主题?

标签: cassandra apigee usergrid


【解决方案1】:

在 Usergrid 2.x 中,我们使用 ElasticSearch 进行索引,因此这两种结构之间应该没有功能差异。

在 Usergrid 1.x 中,我们对实体进行非规范化并在 Cassandra 之上使用索引方案,因此它们的性能可能相同。

也就是说,您应该测试并确保这一点,就像使用任何软件/解决方案一样。

【讨论】:

  • Apigee BaaS 使用什么版本?
  • api.usergrid.com 使用 1.0。 Apigee 客户正在迁移到 2.x
猜你喜欢
  • 2012-02-16
  • 1970-01-01
  • 2022-01-15
  • 2021-03-30
  • 2018-06-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-21
相关资源
最近更新 更多