I'm trying to use Cosmos DB as a key-value store, and read the data from Function App. In case no data is found, the app should write the data into Cosmos DB.
My Function App and Cosmos DB both located in UK South.
I have set /id as partition key, and the keys being used as id. The ids are usually a few characters long, very max 40 byte.
The stored values are longer (1-1.5kb).
The read responses are rather slow (100-500ms, with around 250ms being the average). This performance result only reflects the db query itself, not the whole function.
According to the docs here https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-model-partition-example read item should be ~2ms, so I'm lost where the performance difference is coming from.
I'm using python for the query, following the python cosmos db documentation:
container.read_item(id, partition_key=id)