From the course: Azure Cosmos DB: SQL API Deep Dive

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Time to live

Time to live

From the course: Azure Cosmos DB: SQL API Deep Dive

Start my 1-month free trial

Time to live

- [Instructor] If we have a database ingesting data regularly, the amount of data we're storing can be enormous. For some scenarios, we may intend to keep or archive all of this data in some way. But there are a lot of scenarios we may want to regularly purge data from our database. For example, we may have shopping cart data that is only good for a certain amount of time per customer. Another example would be cache data that grows stale after some time. For many database servers we can implement a Time to Live, or TTL, value that specifies how long data should live in our database. Azure Cosmos DB is no different in this regard. It supports TTL values for records in our containers. To use the TTL feature, you must first enable the TTL feature at the container level. This feature is disabled by default. If you enable this feature, you can opt to set a default TTL value, specified in seconds, at the container level,…

Contents