在您自己的观点中,您如何在 azure 中逻辑地设计表格?特别是当表可以与其他表具有一对多关系时。
这是给定的数据:
Given 是product
表,其中PartitionKey
和Rowkey
wherePartitionKey
用作ID
的Owner (the owner of the product) plus the category
。
i.e: hashedowneridstringtype_Cellphone
并Rowkey
作为unique id of the product.
i.e: S6102DXMA2
那是azure table的现有设计,我必须在下面创建以下表格。而且由于我对如何在 azure 中反映它没有足够的想法,我不得不使用关系表来设计它:
产品可以有用户的评论。
----------------------------------------------------------------------------------
Review table
Fields:
ReviewID - long
Title - string
Review - string
OwnerID - long
DatePosted - Date
----------------------------------------------------------------------------------
ProductReview table
Fields:
ProductID - long
ReviewID - long
----------------------------------------------------------------------------------
用户可以对评论发表评论。
----------------------------------------------------------------------------------
Comment table
Fields:
CommentID - long
Comment - string
OwnerID - long
CommentDate - date
EmailUpdate - bool
----------------------------------------------------------------------------------
CommentReview table
Fields:
ReviewID - long
CommentID - long
----------------------------------------------------------------------------------
用户可以对评论、评论和产品进行评分。
----------------------------------------------------------------------------------
Rating table
Fields:
RatingID - long
Points - double
RatedDate - date
OwnerID - long
----------------------------------------------------------------------------------
CommentRating table
Fields:
CommentID - long
RatingID - long
----------------------------------------------------------------------------------
ProductRating table
Fields:
ProductID - long
RatingID - long
----------------------------------------------------------------------------------
在 azure 中设计表格时我应该考虑哪些事情?