There are many use cases where auto expiry of documents work perfectly, such as maintaining session state, shopping carts, and price quotes for travel. Applications using Couchbase Server set the expiry time to seconds, minutes or hours to manage user behavior. The server has built-in intelligence to make data disappear at the given expiry time, but also allows for renewal or notifications of expiring data through a process that queries upcoming expirations of documents, which can be done faster with global indexes and N1QL. Global indexes hold an advantage over map/reduce views due to their ability to partition independently from data, reside on a single node, and not require the same hardware for indexing as data nodes. To detect data that is expiring, documents are indexed by expiration time using GSI, and queries can be used to retrieve documents expiring in a given timeframe, such as the next 30 seconds.