Design Strava
Understanding the Problem
🏃♂️🚴♀️ What is Strava ?
Strava is a fitness tracking application that allows users to record and share their physical activities, primarily focusing on running and cycling, with their network. It provides detailed analytics on performance, routes, and allows social interactions among users.
While Strava supports a wide variety of activities, we'll focus on running and cycling for this question.
Functional Requirements
Core Requirements
- Users should be able to start, pause, stop, and save their runs and rides.
- While running or cycling, users should be able to view activity data, including route, distance, and time.
- Users should be able to view details about their own completed activities as well as the activities of their friends.
Below the Line (Out of Scope)
- Adding or deleting friends (friend management).
- Authentication and authorization.
- Commenting or liking runs.
Non-Functional Requirements
Core Requirements
- The system should be highly available (availability >> consistency).
- The app should function in remote areas without network connectivity.
- The app should provide the athlete with accurate and up-to-date local statistics during the run/ride.
- The system should scale to support 10 million concurrent activities.
Pattern: Scaling Writes
The strategies we've discussed here are all common among systems where we need to scale writes. This challenge is common to many system design challenges and it's useful to understand the pattern for instances where interviewers may want to dive deeper.