Concept Flow - EXPIRE and TTL for time-to-live
Set Key with Value
Apply EXPIRE with seconds
Key has TTL countdown
Check TTL with TTL command
If TTL > 0
→Key exists
No
TTL expired
→Key deleted
This flow shows how a key is set, given a time-to-live (TTL) with EXPIRE, and how TTL counts down until the key is deleted.