Dev.to
7/23/2026

The user wants me to rewrite a headline for a mobile feed. Let me analyze the original:
Original: Designing a User Online/Offline Presence System: From Naive Polling to Redis TTLs
Short summary
A practical walkthrough of designing a user online/offline presence system, progressing from a naive boolean column through heartbeat polling to a Redis TTL-based approach. The key insight is that presence is ephemeral state that doesn't belong in a primary transactional database. The author provides working Python/FastAPI code using Redis SET with EX for automatic expiry, eliminating timestamp math and self-healing on restart.
- •Naive is_online column fails because users don't explicitly log out
- •Heartbeat polling works but hammers the primary DB with constant writes
- •Redis TTL keys treat presence as ephemeral state: SET key EX 30, then EXISTS to check online status
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



