Docs
Skip to content

DocumentsDB

Bulk operations_

Perform bulk operations on documents within your collections for efficient data handling.

3 min read

Raw

Appwrite DocumentsDB supports bulk operations for documents, allowing you to create, update, or delete multiple documents in a single request. This can significantly improve performance for apps as it allows you to reduce the number of API calls needed while working with large data sets.

Bulk operations can only be performed via the server-side SDKs. The client-side SDKs do not support bulk operations by design to prevent abuse and protect against unexpected costs. This ensures that only trusted server environments can perform large-scale data operations.

For client applications that need bulk-like functionality, consider using Appwrite Functions with proper rate limiting and validation.

Atomic behavior

Bulk operations in Appwrite are atomic, meaning they follow an all-or-nothing approach. Either all documents in your bulk request succeed, or all documents fail.

This atomicity ensures:

  • Data consistency: Your database remains in a consistent state even if some operations would fail.
  • Race condition prevention: Multiple clients can safely perform bulk operations simultaneously.
  • Simplified error handling: You only need to handle complete success or complete failure scenarios.

For example, if you attempt to create 100 documents and one fails due to a validation error, none of the 100 documents will be created.

Plan limits

Bulk operations have different limits based on your Appwrite plan:

PlanDocuments per request
Free100
Pro1,000

These limits apply to all bulk operations including create, update, upsert, and delete operations. If you need higher limits than what the Pro plan offers, you can inquire about a custom plan.

Create documents

You can create multiple documents in a single request using the createDocuments method.

Update documents

You can update multiple documents in a single request using the updateDocuments method.

Upsert documents

You can upsert multiple documents in a single request using the upsertDocuments method.

Delete documents

You can delete multiple documents in a single request using the deleteDocuments method.

Use transactions

All bulk operations accept transactionId. When provided, Appwrite stages the bulk request and applies it on commit. See Transactions.

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.