CallDrop is adding 1-on-1 video calling to an existing messaging app. Unlike large group calls, 1-on-1 calls use peer-to-peer (WebRTC) when possible. The system needs:
- Signaling server - exchange WebRTC offer/answer SDP and ICE candidates between the two peers to establish a direct connection.•NAT traversal - use STUN servers to discover public IP/port. When direct connection fails (~20% of cases), fall back to a TURN relay server.•Call flow - caller initiates → callee receives push notification or in-app alert → callee accepts → WebRTC connection established → call in progress → either party hangs up.•Adaptive quality - automatically adjust video resolution and frame rate based on available bandwidth (measure via RTCP feedback).•Call history - log every call: participants, start/end time, duration, and quality metrics (packet loss, jitter).•Missed calls - if the callee doesn't answer within 30 seconds, log as missed and send a notification.
Targeting 500,000 concurrent calls at peak with 50 million calls per day.
Design a peer-to-peer video calling feature with signaling, NAT traversal, call history, and adaptive quality. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> Load Balancer -> API Gateway -> API Service -> Auth Service -> Primary NoSQL DB -> Realtime Bus -> Monitoring