在不使用分区键的情况下创建comos db集合仍然是一个好主意吗? [英] Is it still a good idea to create comos db collection without partition key?

查看:99
本文介绍了在不使用分区键的情况下创建comos db集合仍然是一个好主意吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一位同事说,cosmos db将停止支持没有分区键的集合.但是我找不到Microsoft提供的有关此声明的任何信息.

One colleague said that cosmos db will stop supporting collections without a partition key. But I can't find any information about this statement from Microsoft.

我正在处理的应用程序具有订单记录的集合.一个典型的查询返回成千上万的这些记录.因此,如果我使用订单ID作为分区键,它将始终运行跨分区查询....而且要求是获取所有租户之间的所有记录,因此也不能选择按租户ID进行分区.

The application I'm working on has a collection of order records. A typical query returns 10s of thousands of these records. So if I use order id as partition key, it'll always run cross partition queries.... And the requirement is to get all records across all tenants, so partition by tenant id isn't an option, either.

我认为只创建一个没有分区键的集合就可以了.稍后我会担心数据的归档(可能是使用Azure函数和更改Feed).

I thought it'll be fine just create a collection without a partition key. I'll worry about archiving data later (probably with azure functions and change feed).

这样做是个好主意吗?

推荐答案

一位同事说cosmos db将停止支持收藏 没有分区键.但我找不到有关此的任何信息 微软的声明.

One colleague said that cosmos db will stop supporting collections without a partition key. But I can't find any information about this statement from Microsoft.

根据cosmos db门户的提示,此消息仅限于门户.

Based on the tips on the cosmos db portal,this message is confined to portal only so far.

您仍然可以使用sdk创建未分区的集合:

You still could create non-partitioned collection by using sdk:

DocumentCollection collection = new DocumentCollection();
collection.set("id","jay");
ResourceResponse<DocumentCollection> createColl = client.createCollection("dbs/db",collection,null);

所以,我认为您的服务现在不会受到影响.至于未来的趋势,我建议您更多关注Microsoft的官方声明.如果有特殊需要,可以提交反馈以寻求帮助.

So,i think your service will not be affected by now. As for future trends, I suggest you pay more attention to Microsoft's official statement. If you have any special needs, you can submit feedback for help.

这篇关于在不使用分区键的情况下创建comos db集合仍然是一个好主意吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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