gpt4 book ai didi

Azure 表存储数据建模注意事项

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

我有一个用户列表。用户可以使用用户名或电子邮件地址登录。

作为 Azure 表存储的初学者,这就是我为快速索引扫描的数据模型所做的事情。

PartitionKey    RowKey                        Property
users:email <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4f252e2c24360f2a222e2623612c2022" rel="noreferrer noopener nofollow">[email protected]</a> nickname:jack123
users:username jack123 email:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="452f24262e3c052028242c296b262a28" rel="noreferrer noopener nofollow">[email protected]</a>

因此,当用户通过电子邮件登录时,我将在 azure 表查询中提供 PartitionKey eq users:email 。如果是username,则Partition eq users:username

由于在azure表查询中似乎不可能模拟containslike,我想知道这是否是存储多行数据的正常做法1 位用户?

最佳答案

Since it doesn't seem possible to simulate contains or like in azure table query, I'm wondering if this is a normal practice to store multiple row of data for 1 user ?Since it doesn't seem possible to simulate contains or like in azure table query, I'm wondering if this is a normal practice to store multiple row of data for 1 user ?

这是一种完全有效的做法,实际上也是推荐的做法。本质上,您必须确定可以查询表存储的属性,并以某种方式将它们用作 PartitionKeyRowKey 的组合。

请参阅Guidelines for table design了解更多信息。通过此链接:

Consider storing duplicate copies of entities. Table storage is cheap so consider storing the same entity multiple times (with different keys) to enable more efficient queries.

关于Azure 表存储数据建模注意事项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54977194/

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