Back to explorer
System Architectures 5 Min

Strava

MEDIUM

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.

code
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