You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/performance-tips-java-sdk-v4.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,16 +148,16 @@ This mechanism helps to continuously monitor partition health and ensures that r
148
148
### Comparing availability optimizations
149
149
150
150
-**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).
153
153
-**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.
154
154
155
155
-**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.
158
158
-**Use Case**: Ideal for write-heavy or mixed workloads where consistent performance is essential, especially when dealing with partitions that may intermittently become unhealthy.
159
159
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.
161
161
162
162
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.
0 commit comments