Azure DocumentDb存储限制-它们到底是什么意思? [英] Azure DocumentDb Storage Limits - what exactly do they mean?

查看:82
本文介绍了Azure DocumentDb存储限制-它们到底是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure DocumentDb似乎具有一些奇怪的存储限制 :

Azure DocumentDb seems to have some strange storage limits:

--------------------------------------------------------------------
| Entity                           | Default quota (Standard Offer)|
-------------------------------------------------------------------|
| Document storage per collection  | 250 GB*                       |
-------------------------------------------------------------------|
| Throughput per collection,       | 250,000 RU/s*                 |
| measured in Request Units per    |                               |
| second per collection            |                               |
-------------------------------------------------------------------|
| Request document size            | 512 KB*                       |
-------------------------------------------------------------------|
| Response document size           | 1MB                           |
-------------------------------------------------------------------|

请求文档的大小-这是否意味着在没有请求支持的情况下发送用于存储在documentdb中的json有效负载的大小不能大于512KB?

Request document size - Does that mean that the size of the json payload that gets sent for storage in the documentdb can't be bigger than 512KB without a request to support?

此外,如果请求支持以获取更大的请求文档尺寸,则对此有何限制?我可以要求1MB吗? 2MB?

Also, if a request to support is made for a larger request document size, what are the limits on that? Can I ask for 1MB? 2MB?

响应文档的大小-这是否意味着json响应的大小不能超过1MB?除了最简单的实体,这似乎几乎没有用.

Response document size - Does that mean that the size of the json response can't exceed 1MB? That hardly seems useful for anything but the simplest entities.

推荐答案

更新:自2016年12月起,DocumentDB已将默认文档大小配额增加到2mb,将页面大小配额增加到4mb

DocumentDB团队在这里.看来我们的限制"页面上的措词可以改进...同时,请允许我尝试澄清一下:

DocumentDB team here. It looks like the wording on our "limits" page can be improved... In the meantime, allow me to try to clarify:

文档大小配额(默认值:每个文档2MB)

默认文档大小配额为每个文档2MB.换句话说,您可以在每条记录中存储< = 2MB的JSON,而无需发送票证. 参考: https://docs.microsoft.com/en -us/azure/cosmos-db/documentdb-resources#documents

The default document size quota is 2MB per document. In other words, you are able to store <=2MB worth of JSON in each and every record - without having to send in a ticket. Reference: https://docs.microsoft.com/en-us/azure/cosmos-db/documentdb-resources#documents

我们正在积极地进行一些长期改进,以广泛地提高我们的默认配额.同时,您可以提交支持请求,以立即预览DocumentDB帐户上更大的文档大小配额.

We are actively working on some long term improvements to increase this our default quota broadly. In the meantime, you can submit a support request to enable a preview of higher document size quotas on your DocumentDB account today.

还值得注意的是-大多数大于2MB的文档(通常来说)都涉及大型无边界数组-在这种情况下,最好将每个数组元素抽象出来并建模为单独的文档.

Also worth noting - most documents (generally speaking) that are >2MB involve large unbounded arrays - in which it would better to abstract out and model each array element as a separate document.

每页结果的响应大小配额(默认值:每页4MB)

要清楚-DocumentDB允许查询结果的任意大小(例如1 KB,1 GB,1 TB等).

To be clear - DocumentDB allows query results of any arbitrary size (e.g. 1 KB, 1 GB, 1 TB, etc).

对于较大的查询结果-DocumentDB将对结果进行分页,并且每个页面将被限制为响应大小配额(默认情况下,每页4MB).

For large query results - DocumentDB will paginate results, and each page will be limited to the response size quota (by default, 4MB per page).

为什么分页查询结果是一个很酷的功能:

您是否曾经在另一个数据存储区(而不是DocumentDB)中运行查询,这似乎要花很长时间...如果一个查询要花一个小时才能完成-您如何确定这将花费数分钟还是数小时?根本没有进展吗?

Have you ever run a query in another data store (other than DocumentDB), and it seems to take forever... If a query takes an hour to complete - how can you tell if it will take minutes vs hours vs is progress is being made at all?

DocumentDB通过将查询结果分成一组可以迭代的页面来解决此问题.根据许多标准对结果进行分页:

DocumentDB resolves this by splitting query results in to a set of pages that you can iterate through. The results are paginated on a number of criteria:

  • 每页最大响应大小:4 mb
  • 每页最大时限:5秒
  • 如果您用了相当大的缓冲区来耗尽已配置的吞吐量(取决于已配置的吞吐量)

这意味着您能够立即流式传输并利用查询结果,并控制恢复执行查询的速度.

This means you are able to stream and take advantage of query results right away, as well as control the rate you resume execution of queries.

以下代码段说明了如何使用C#.NET SDK一次检索一页查询结果:

The following snippet illustrates how to retrieve query results 1 page at a time using the C# .NET SDK:

var query = client.CreateDocumentQuery<Family>(collectionUri, "SELECT * FROM Families", options).AsDocumentQuery();
while (query.HasMoreResults)
{
    foreach (Family family in await query.ExecuteNextAsync())
    {
        families.Add(family);
    }
}

以下代码段说明了如何按照常规方式让客户端SDK遍历分页结果并代表您具体化整个查询结果:

The following snippet illustrates how to conventionally have the client SDK iterate through paginates results and materialize the entire query result on your behalf:

var families= client.CreateDocumentQuery<Family>(collectionUri, "SELECT * FROM Families", options).toList();

这篇关于Azure DocumentDb存储限制-它们到底是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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