Strava
Design Strava (Fitness Tracking & Segment Leaderboards)
Strava is a fitness application tracking GPS workouts, routes, and segment completion leaderboards.
1. High-Level Design
This architecture requires an optimized GPS ingest pipeline alongside high-speed leaderboard evaluations.
Client GPX Coordinates ---> API ---> Ingest Processor ---> S3 Raw Store
|
Flink Segment Parser ---> Redis Sorted Sets (Leaderboard)Components
1. GPX Ingest Service: Ingests route JSON/GPX coordinate arrays from client devices and stores raw logs in S3.
2. Segment Matching Engine: An async pipeline (Apache Flink) checking GPX coordinate overlays against predefined segment coordinate paths on the earth.
3. Leaderboard Cache: Manages athlete rankings for segments. Powered by Redis Sorted Sets (ZSET).
2. Potential Deep Dives
- Real-time Leaderboard Processing:
Each segment has a Redis ZSET. The athlete's ID is the member, and their completion time is the score. Redis handles score insertions and rank range lookups in O(log(N)) time.
- GPS Jitter Resolution:
Use Kalman filter algorithms in the segment processor to smooth GPS tracking data and remove signal bounce.
3. References & Tech Blogs
Related Topics
Expand your knowledge by learning about adjacent concepts in system design.
Design a URL Shortener (TinyURL)
Build a high-throughput shortener analyzing base58 encodings and database sharding.
Networking Essentials
Learn the important parts of networking that you'll need to know for your system design interviews
API Design
Learn about API design for system design interviews
Cheat Sheet Utility
View and print a concise system design reference card.