Design: Online Presence System
Design covers real-time presence tracking, status updates, and querying presence. Does not cover user authentication system, messaging, or notification delivery.
Functional Requirements
FR1: Track and display users' online/offline status in real-time
FR2: Support up to 100,000 concurrent users
FR3: Allow users to see the presence status of their contacts/friends
FR4: Update presence status within 2 seconds of change
FR5: Provide an API for clients to query presence status
FR6: Handle user login, logout, and idle states
FR7: Ensure data consistency and availability
Non-Functional Requirements
NFR1: System must have 99.9% uptime
NFR2: API response latency p99 under 200ms
NFR3: Scale to 100,000 concurrent connections
NFR4: Support mobile and web clients
NFR5: Data retention for presence status is 24 hours
