Azure DocumentDb seems to have some strange storage limits:
--------------------------------------------------------------------
| Entity
Update: As of December 2016, DocumentDB has increased the default document size quota to 2mb and page size quota to 4mb
DocumentDB team here. It looks like the wording on our "limits" page can be improved... In the meantime, allow me to try to clarify:
Document Size Quota (default: 2MB per document)
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
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.
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.
Response Size Quota per Page of Results (default: 4MB per page)
To be clear - DocumentDB allows query results of any arbitrary size (e.g. 1 KB, 1 GB, 1 TB, etc).
For large query results - DocumentDB will paginate results, and each page will be limited to the response size quota (by default, 4MB per page).
Why paginated query results is a really cool feature:
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 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:
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.
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);
}
}
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();