Design Location Sharing
MediumSystem design · Location · DoorDash · Uber
Design a service where users share live location with chosen friends or groups. Scale: 50M users, 5M sharing at once, an update every 5 to 30 seconds (about 500K writes/s at peak), watchers see movement within 3 seconds, and shares expire by default. Cover client-side update suppression and battery use, storing only the latest position, permission checks at fan-out time, a grid index for nearby queries, geofence alerts, retention of history, and the privacy choices including end-to-end encryption.
Requirements
- Respect directional, scoped, expiring grants; revocation takes effect immediately
- Store only the latest position per user; keep history opt-in, downsampled and expiring
- Reduce updates on the device by movement thresholds and batching to protect the battery
- Nearby or geofence queries use a spatial grid and never expose data the viewer is not entitled to