Skip to content

Cosmos Driver: Prime metadata caches at client creation time #3793

@analogrelay

Description

@analogrelay

The Cosmos DB SDK really depends on having full metadata for a container in order to perform operations. Right now, that metadata is lazy-loaded, which means a lot of operations can take a longer amount of time because the cache needs to be populated on the first request. We normally refresh the cache in the background, so it's only this cache priming operation that takes longer.

In order to simplify the clients a bit, and make that behavior clearer to users, let's make DatabaseClient::container_client and CosmosClient::database_client async, and have them perform the cache priming IN the actual creation function.

We're already making these functions async, but this work item track doing the cache priming in those now-async functions.

Metadata

Metadata

Assignees

Labels

CosmosThe azure_cosmos crate

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions