作为我们为应用程序实现的运行状况检查的一部分,我们尝试将虚拟文档写入数据库。对于此文档,我们使用 10 秒的 TTL(生存时间),以便 Cosmos DB 自动清理文档。
我的问题是:将 TTL 一直设置为 1 秒是否有缺点(性能、RU 成本等)?一旦文档写入成功,健康检查就快乐了,我们就不再关心文档了。
最佳答案
低 TTL 设置不会带来任何负面影响、性能下降或额外成本。 如果您查看此文档 HERE 。它指出。
Deletion of expired items is a background task that consumes left-over Request Units, that is Request Units that haven't been consumed by user requests. Even after the TTL has expired, if the container is overloaded with requests and if there aren't enough RU's available, the data deletion is delayed. Data is deleted once there are enough RUs available to perform the delete operation. Though the data deletion is delayed, data is not returned by any queries (by any API) after the TTL has expired.
关于Azure Cosmos DB - 使用非常低的 TTL 进行运行状况检查项目有什么缺点吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69842279/