简体   繁体   English

单独的表与Azure表存储(NoSQL)中的一个大表

[英]Separate tables vs. one big one in Azure table storage (NoSQL)

I'm using Azure Tables and I'm trying to figure out how I should organize my data. 我正在使用Azure表,并且试图弄清楚如何组织数据。

Each entity in a table has a PartitionKey and a RowKey and my understanding is that partitions should be used to organize similar objects for scalability. 表中的每个实体都有一个PartitionKey和RowKey,我的理解是,应该使用分区来组织相似的对象以实现可伸缩性。 In the example on the site they used movie entities where the category (action, sci fi, etc) is the PartitionKey while the title (fast and the furious, etc.) is the RowKey. 在该站点的示例中,他们使用了电影实体,其中类别(动作,科幻等)是PartitionKey,而标题(快速和狂怒等)是RowKey。

Going with the above example, lets say we have no duplicate movies and you also wanted to keep track of each particular movies rental history, ie location, due date, customer, etc. 在上面的示例中,假设我们没有重复的电影,并且您还想跟踪每个特定电影的租借历史,例如位置,到期日期,客户等。

Would it be bad practice to have one table to store all of this and use a separate partition for the rental entities? 如果有一个表来存储所有这些表并为出租实体使用单独的分区,这将是不好的做法吗? To be clear, I'm talking about a movie item and its corresponding history items together in the same denormalized table in separate partitions. 明确地说,我是在同一分区的同一张非规范化表中一起谈论电影项及其对应的历史项。

Would there be an advantage to using two separate tables and if not, then what is the point of tables? 使用两个单独的表是否有优势,如果没有,那么表的目的是什么?

EDIT: 编辑:
PartitionKey| PartitionKey | RowKey | RowKey | prop0 | prop0 | prop1 |... prop1 | ...
------------------------------------------------... ------------------------------------------------ .. 。
SciFi | 科幻| StarWars| 星球大战| foo0: bar0 | foo0:bar0 | foo1: bar1|... foo1:bar1 | ...
Rental | 出租| StarWars| 星球大战| foo0: bar0 | foo0:bar0 | foo1: bar1|... foo1:bar1 | ...

First of all the notion of table storage is that you can "dump" large amounts of data knowing that search facilities are very poor, you won't be able to issue SQL queries, hence no RDBMS and that it is a means of storing much data. 首先,表存储的概念是,您可以“转储”大量数据,因为他们知道搜索功能非常差,您将无法发出SQL查询,因此没有RDBMS,这是一种存储大量数据的方法数据。 Indeed, partitionKey and rowKey are the only indexed columns you get with Azure storage, this means that searching by partitionKey or rowKey will be quicker than searching by any other column. 的确,partitionKey和rowKey是使用Azure存储获得的唯一索引列,这意味着通过partitionKey或rowKey进行搜索将比通过其他任何列进行搜索更快。 If you need to retrieve data swiftly then blob storage or table storage is a no-go. 如果您需要快速检索数据,则无法进行Blob存储或表存储。 If you just want to keep a record for audit purposes or history purposes then yes. 如果您只想出于审计或历史目的保留记录,则可以。 However, if you want to use it in a video store for instance and need to retrieve client's details, then as I mentioned it's bad practice. 但是,例如,如果您想在视频商店中使用它,并且需要检索客户的详细信息,那么正如我所提到的,这是一种不好的做法。 You'd better of using RDBMS. 您最好使用RDBMS。 Lastly, you can't do JOIN or other RDBMS queries etc in table storage ie between two tables. 最后,您不能在表存储中(即两个表之间)进行JOIN或其他RDBMS查询等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM