Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gotcha: Max 100 items per batch!?! #1057

Closed
joshlang opened this issue Nov 27, 2019 · 3 comments
Closed

Gotcha: Max 100 items per batch!?! #1057

joshlang opened this issue Nov 27, 2019 · 3 comments
Labels
Batch Batch related issue

Comments

@joshlang
Copy link
Contributor

I tried to create 101 documents in a batch and received a 400 (Bad Request) result from the server with the error Batch request has more operations than what is supported.

Creating 100 documents works fine. Clearly, there is a limit of 100 operations per batch.

This is consistent with the table storage API. But ...really... who's ever heard of that, even :D

There's no documentation I could find anywhere which says the SQL API has the same limitations. The only hint I could find was this issue over here: Azure/azure-documentdb-datamigrationtool#39

I suggest:

  • Add documentation that 100 docs is the max
  • Throw an exception when adding operation 101 to TransactionalBatch. This makes it clear what the problem is exactly when it happens

...I also suggest removing the 100 doc and 2mb payload limit altogether, but... ...yeah, good luck with that :D

@ealsur ealsur added the Batch Batch related issue label Nov 27, 2019
@joshlang
Copy link
Contributor Author

FYI: While testing, I was able to create ~8400 documents (empty-ish) with a single call to a stored procedure on a collection with only 400 RU/s allocated. Results are variable, of course.

@ealsur
Copy link
Member

ealsur commented Dec 2, 2019

@abhijitpai Do we have the differences between Stored Procedures and Batch documented somewhere?

@abhijitpai
Copy link
Contributor

We have the transactional batch limit now documented at https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits#per-request-limits. We will look at increasing this over time but as discussed in #1059 the limit allows for predictability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Batch Batch related issue
Projects
None yet
Development

No branches or pull requests

3 participants