John Liu Blog

Every drop counts

Azure Cosmos DB study notes

TTL (time-to-live): max 2,147,483,647seconds (~68years) For TTL to work at either container or item level, it needs to be enable/configured at container level first. If only configured at item level, it will be ignored unless TTL is enabled/configured at container level default TTL is not configured max configureable TTL is ? Previsioned throughput vs. serverless: previsioned throughput is ideal for predictable traffic patterns that require sustained and predictable performance with minimal variance Serverless can handle wildly varying traffic and low average-to-peak traffic ratios

Azure Cosmos DB Emulator

We can use Azure CosmosDB emulator to simulate Azure CosmosDB without actually connect to Azure environment. The emulator is running inside a container. To setup the container using the latest image: docker run -it --name cosmosDB -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator This will create a container named cosmosDB and the emulator access port is 8081. When .Net code connect to the emulator, you might receive error about “The SSL connection could not be established” and “The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot”.