Ongoing requests will be canceled if the timeout setting is reached. The Java SDK now supports an end-to-end timeout policy, allowing developers to provide a timeout value that covers the whole execution of any request, including requests that span multiple partitions. We observed that many customers want to set aggressive end-to-end timeouts, which ultimately impacted tail latency and effectively caused availability to drop significantly since requests were not being canceled. Merging partitions in Azure Cosmos DB are now fully supported for the Java SDK, Spark Connector, and Spring Data Client Library! createItem( item, new PartitionKey( pkValue), optionsWithRetry). setNonIdempotentWriteRetryPolicy( ENABLE_RETRIES, USE_TRACKING_ID) ĪsyncContainer. String pkValue = "myPKValue" // whatever the logical partition key value is boolean ENABLE_RETRIES = true ĬosmosItemRequestOptions optionsWithRetry = new CosmosItemRequestOptions() But now, developers can now opt-in to retrying writes at a request level, even when these conditions are not met. Previously the SDK would only issue retries for write operations when the failure condition happened before the request was actually written to the network, or when the error code from the service guarantees that the service never processed the request. We’ve added support for retrying writes when they are not guaranteed to be idempotent. Check out code examples here! Note: this is currently available only for the core Java SDK, and is not yet supported for the other connectors at the time of writing. Support for hierarchical partition keys in Azure Cosmos DB was made GA for the Java SDK in March 2023. setAggressiveWarmupDuration( aggressiveWarmupDuration) setProactiveConnectionRegionsCount( proactiveConnectionRegionsCount) asList( containerIdentity1, containerIdentity2)) openConnectionsAndInitCaches( new CosmosContainerProactiveInitConfigBuilder( Arrays. asList( "sample_region_1", "sample_region_2")) building the client along with opening connections CosmosAsyncClient clientWithOpenConnections = new CosmosClientBuilder() duration for which connections are to be aggressively opened in a blocking manner // beyond this duration connections will be defensively opened in a non-blocking manner Duration aggressiveWarmupDuration = Duration. of regions to which connections are to be proactively opened int proactiveConnectionRegionsCount = 1 containers to which connections are to be proactively opened CosmosContainerIdentity containerIdentity1 = new CosmosContainerIdentity( "sample_db_id", "sample_container_id_1") ĬosmosContainerIdentity containerIdentity2 = new CosmosContainerIdentity( "sample_db_id", "sample_container_id_2") Once this duration elapses, connections are established defensively but in a non-blocking manner. A duration can also be specified within which connections are established aggressively in a blocking manner. Reducing overall latency for writes in multi-region scenarios where only a single write region is configured.ĭefine the number of regions for which you want connections to be warmed up, and the SDK will use the list of preferred regions configured through CosmosClientBuilder.Improving tail latency in cross-region failover scenarios (for example with speculative processing).Some scenarios in which you may want to do this would include: Developers can now warm up connections and caches for containers for both the current read region and a pre-defined number of preferred remote regions, as opposed to just the current read region. In February 2023 proactive connection management was added to the Java SDK. Check out the documentation here, and the fully worked sample here! Check out this blog for more details!Īzure Active Directory authentication support for Spark ConnectorĪzure Active Directory support was added in February 2023 for the OLTP Spark connector. Developers can now implement a database per tenant or container per tenant performance isolation model seamlessly integrated into the Spring Data Repository abstraction layer. In January 2023 we added enhanced support for building multi-tenant applications in Azure Cosmos DB using the Azure Cosmos DB Spring Data Client Library. Spring data – enhanced multi-tenancy support
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |