JDBC Driver for Azure Cosmos DB

Build 22.0.8462

Setting a RU Budget for Batch Writes

Just as described in the SQL Compliance the driver supports batch CUD (Create, Update, Delete) operations. Batch processing is achieved by issuing multiple requests simultaneously. Even though this method greatly improves the performance for write operations, the cost of these operations is relatively high, thus the Request Units (RU) budget per second for a certain container or database may be exceeded. Depending on your Azure Cosmos DB Service Quotas, exceeding the RU budgets may incur in extra costs, or it may even temporary throttle or interrupt the Azure Cosmos DB usage for other workloads.

In order to avoid exceeding the RU budget per second, the driver dynamically adjusts the number of concurrent requests per second depending on the set WriteThroughputBudget and the constantly adjusted average RU cost per statement. The user can utilize the WriteThroughputBudget connection property to define the RU budged per second, that batch write operations should not exceed. Another important factor in batch write operations is the MaxThreads connection property, which specifies the maximum number of concurrent requests. If using a low MaxThreads value, the driver might not be able to efficiently use the available budget.

Since the requests throttling logic is applied client-side, in a few cases the RU/s budged may be exceeded by a relatively small amount. These cases include Inserting, Updating and Deleting records with highly variable column count and input value length per column.

Note: By default, the WriteThroughputBudget property is set 1000 RU/s and the MaxThreads property is set to 200 threads.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462