Data API limits
The Data API includes guardrails to ensure best practices, foster availability, and promote optimal configurations for your Astra DB Serverless databases.
In the following table, the term property refers to either a field of a document in a collection or a column in a table. |
Entity | Limit | Notes |
---|---|---|
Number of collections per database |
5 or 10 (approx.) |
Indexes determine the number of collections you can have in a database. Serverless (Vector) databases created after June 24, 2024 can have approximately 10 collections. Databases created before this date can have approximately 5 collections. The collection limit is based on the number of indexes. For more information, see Indexes in collections. |
Number of tables per database |
50 |
A Serverless (Vector) database can have up to 50 tables. |
Page size |
20 |
For certain operations, a page can contain up to 20 documents or rows. After reaching the page limit, you can load any additional responses on the next page:
Some operations, such as
|
In-memory sort limit |
10,000 |
Operations that require fetching and sorting chunks of data can support no more than 10,000 rows in-memory. In this case, rows refers to either documents in collections or rows in tables. If your queries hit this limit, try restructuring your application to avoid running queries on excessively large chunks of data.
For example, in tables, you can adjust your table’s If you frequently hit this limit in collections, consider whether your data needs to be stored in tables, which can be more performant for large datasets. |
Maximum property name length |
100 |
Maximum of 100 characters in a property name. |
Maximum path length |
1,000 |
Maximum of 1,000 characters in a path name.
This is calculated as the total for all segments, including any dots ( |
Maximum indexed string size in bytes |
8,000 |
Maximum of 8,000 bytes (UTF-8 encoded) for |
Maximum number property length |
100 |
Maximum of 100 characters for the length of a |
Maximum elements per array |
1,000 |
Maximum number of elements in an array. This limit applies to indexed fields in collections only. |
Maximum vector dimensions |
4,096 |
Maximum size of dimensions you can define for a vector-enabled collection. |
Maximum properties per JSON object |
1,000 |
Maximum number of properties for a JSON object, including top-level properties and nested properties. This limit applies to JSON objects stored in indexed fields in collections only. A JSON object can have nested objects, also known as sub-documents. The maximum of 1,000 includes all indexed properties in the main document and those in each sub-document, if any. For more information, see Indexes in collections. |
Maximum depth per JSON object |
16 |
Maximum depth of nested properties (sub-documents) in a JSON object. |
Maximum properties per JSON document |
5,000 |
The maximum number of properties allowed in for an entire JSON document is 5,000, including intermediate properties and leaf properties. For example, the following document has three properties that apply to this limit:
|
Maximum document or row size in characters |
4 million |
A single document in a collection can have a maximum of 4 million characters. |
Maximum inserted batch size in characters |
20 million |
An entire batch of documents submitted through an |
Maximum number of deletions per transaction |
20 |
Maximum number of documents that can be deleted in each |
Maximum number of updates per transaction |
20 |
Maximum number of documents that can be updated in each |
Maximum number of insertions per transaction |
100 |
Maximum number of documents or rows that can be inserted in each |
Maximum size of |
100 |
When using the |
Maximum number of vector search results |
1,000 |
For vector search, the response is a single page of up to 1,000 documents or rows, unless you set a lower |
Exceeded limit returns 200 OK with error
If your request is valid but the command exceeds a limit, the Data API responds with HTTP 200 OK
and an error message.
It is also possible to receive a response containing both data and errors. Always inspect the response for error messages.
For example, if you exceed the per-transaction limit of 100 documents in an insertMany
command, the Data API response contains the following message:
{
"errors": [
{
"message": "Request invalid: field 'command.documents' value \"[...]\" not valid. Problem: amount of documents to insert is over the max limit (101 vs 100).",
"errorCode": "COMMAND_FIELD_INVALID"
}
]
}