在创建表的Azure存储目录层次结构 [英] Create Directory Hierarchy Structure in Azure Tables Storage

查看:174
本文介绍了在创建表的Azure存储目录层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在Azure中的表创建类似结构的目录?

我需要存储一些元数据在树状结构。

例如,如果我有10个项目,每个项目包含一些元数据列(还有他们所有[ID,名称,创建日期,作者...]一些常见的列,但可能也有一些列的一个项目可能有,但一个又一个无)

可以将这些物品存放在一个结构性的方式?

 项目1
        | _____项目2
                 | _____项目3
                          | _____ ItemX


解决方案

您不能嵌套你描述的方式,但使用Azure的表,你并不一定需要。
在上面的例子中,我会成立项目1 =分区键。项目2 - > n是否各自为行键。每一行可以有一个独特的模式和放大器;每个项目将是指数的一部分,所以查找就非常快。

行键只需要分区中是唯一的,所以如果需要的话你可以有一个重复模式(硬从递减告诉)。

然后,您可以通过查询对PK获得相关项目1的所有项目,或通过指定PK + RK得到一个单独的项目。

Is it possible to create a directory like structure in Azure Tables?

I need to store some metadata in a tree like structure.

For example if I have 10 items and each item contains some metadata columns (there are some common columns for all of them [id, name, date created, author ... ], but might be also some columns that one item might have but another one no)

Can these items be stored in a structural way?

      Item1
        |_____ Item2
                 |_____ Item3
                          |_____ ItemX

解决方案

You can't nest the way you describe, but using Azure Tables, you don't necessarily need to. In the example above, I would set Item1 = Partition Key. Items 2-->n would each be a Row Key. Each Row can have a unique schema & each item would be part of the index so lookup would be very fast.

Row Keys only need to be unique within the partition, so you could have a repeating pattern if required (hard to tell from the desc.).

You could then get all items related to Item1 by querying against the PK, or get an individual item by specifying PK + RK.

这篇关于在创建表的Azure存储目录层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆