Home > Mobile >  Azure CosmosDB write latencies for different APIs
Azure CosmosDB write latencies for different APIs

Time:07-22

We have a low-latency use case for Azure CosmosDB (eg. adding extra 100ms will be sensitive to the application).

Are there any implications on write latency when choosing an Azure CosmosDB API --

enter image description here

Core SQL is default, but perhaps there are some additional overhead in query parsing etc. So I'd think Cassandra and MongoDB APIs are tailored more towards low-latency use cases, didn't get into testing this yet. Thanks for any insights

CodePudding user response:

There can be some latency differences between the different database APIs but it is nowhere near 100ms for the equivalent payload.

As pointed out in the comments, your assumption about the Core API is incorrect. Core API itself underlies all the other API's which sit atop of it.

Core API is the only one that provides an SLA on latency. This is guaranteed to be less than 10ms for in-region reads and writes at P99 when the payload is 1KB or less and using either .NET or Java SDK via Direct TCP mode (the default).

All other database APIs go through a gateway (as does Core API Python and Node.js SDKs). Also queries are executed on the gateway due to the fact they may talk to different partitions. Gateway also creates query plans and otherwise coordinates query execution.

Bottom line, Cosmos DB is fast across all its database APIs. But if you are trying to squeeze out every ms of latency, use Core API and either the Cosmos DB .NET or Java SDK's.

  • Related