Skip to content

Commit 385f0e1

Browse files
authored
Update performance-tips-java-sdk-v4.md
1 parent df29e32 commit 385f0e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/cosmos-db/nosql/performance-tips-java-sdk-v4.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,16 @@ This mechanism helps to continuously monitor partition health and ensures that r
148148
### Comparing availability optimizations
149149

150150
- **Threshold-based availability strategy**:
151-
- **Benefit**: Reduces tail latency by sending parallel read requests to secondary regions.
152-
- **Cost**: Incurs extra RU (Request Units) costs due to additional cross-region requests.
151+
- **Benefit**: Reduces tail latency by sending parallel read requests to secondary regions, and improves availability by pre-empting requests that will result in network timeouts.
152+
- **Trade-off**: Incurs extra RU (Request Units) costs compared to circuit breaker, due to additional parallel cross-region requests (though only during periods when thresholds are breached).
153153
- **Use Case**: Optimal for read-heavy workloads where reducing latency is critical and some additional cost (both in terms of RU charge and client CPU pressure) is acceptable. Write operations can also benefit, if opted into non-idempotent write retry policy and the account has multi-region writes.
154154

155155
- **Partition level circuit breaker**:
156-
- **Benefit**: Improves write availability and latency by avoiding unhealthy partitions, ensuring requests are routed to healthier regions.
157-
- **Cost**: Does not incur significant additional RU costs as it avoids problematic partitions rather than issuing more requests.
156+
- **Benefit**: Improves availability and latency by avoiding unhealthy partitions, ensuring requests are routed to healthier regions.
157+
- **Trade-off**: Does not incur additional RU costs, but can still allow some initial availability loss for requests that will result in network timeouts.
158158
- **Use Case**: Ideal for write-heavy or mixed workloads where consistent performance is essential, especially when dealing with partitions that may intermittently become unhealthy.
159159

160-
Both strategies can be used to enhance write availability and reduce tail latency. We recommend Partition Level Circuit Breaker as a primary strategy, and additionally Threshold-based Availability Strategy can be used to further minimize tail latency if additional cost is acceptable.
160+
Both strategies can be used together to enhance read and write availability and reduce tail latency. Partition Level Circuit Breaker can handle a variety of transient failure scenarios, including those that may result in slow performing replicas, without the need to perform parallel requests. Additionally, adding Threshold-based Availability Strategy will further minimize tail latency and eliminate availability loss, if additional RU cost is acceptable.
161161

162162
By implementing these strategies, developers can ensure their applications remain resilient, maintain high performance, and provide a better user experience even during regional outages or high-latency conditions.
163163

0 commit comments

Comments
 (0)