Design a Data Ingestion System for Autonomous Vehicle Mapping Fleets
System DesignModel answerLast updated
Design an end-to-end telemetry and sensor data collection system for a mapping fleet, handling route planning, physical/wireless offloading, data quality checks, and privacy sanitization.
Design an end-to-end system that manages a fleet of specialized mapping vehicles deployed to collect high-definition sensor data (Cameras, LiDAR, RADAR, GPS/IMU) for autonomous vehicle maps.
Core Objectives
- Mission Generation & Target Allocation: Systematically identify missing, out-of-date, or changed road segments and generate optimal collection routes for fleet drivers.
- On-Vehicle Offloading & Ingestion: Safely transfer multi-terabyte raw sensor logs from vehicles back to cloud processing storage.
- Quality & Validation Gating: Verify sensor integrity, calibration consistency, dynamic environmental conditions, and geospatial accuracy before ingesting.
- Privacy & Anonymization: Enforce PII masking (faces, license plates) and regulatory compliance before downstream consumers access raw records.
- Storage & Downstream Handoff: Provide an organized spatial-temporal data platform for HD map generation engines.
Assume you are presenting this architecture to an interviewer. Start by stating reasonable scope boundaries, sizing the data scale through back-of-the-envelope calculations, and presenting a modular architecture.
Hints
Hint 1
Calculate the total daily volume per vehicle (e.g., LiDAR + 4K Cameras + GNSS/IMU) to determine whether cellular or physical depot offloading is required.
Hint 2
Think about how roads are represented spatially (e.g., S2 or H3 spatial indexes) to track coverage and staleness efficiently.
Hint 3
Structure your ingestion pipeline around staging buckets, asynchronous validator services, and privacy-preserving transformation jobs.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Requirements & System Sizing
Functional Requirements
- Mission Planning: Track road segment staleness, construction updates, and spatial coverage gaps to issue dynamic collection missions to vehicles.
- Data Offloading: Ingest high-throughput sensor streams via hybrid channels (Cellular for telemetry/metadata; Depot Wi-Fi/NVMe swaps for raw logs).
- Validation & Data Quality: Automatically grade logs for sensor dropout, out-of-sync timestamps, blurring/lighting issues, and poor GPS/localization lock.
- Privacy & Anonymization: Blur PII (faces, license plates) and remove non-permitted geo-fenced regions.
- Map Engine Handoff: Index data by spatial cells (e.g., Uber H3 or Google S2) and time windows, delivering clean datasets to the HD Map generation pipeline.
High-Level Scale & Capacity Estimates
- Fleet Size: 1,000 vehicles operating 8 hours/day.
- Data Generation Rate:
- 6x 4K Cameras @ 15 FPS (~400 MB/s compressed)
- 2x High-Density LiDAR (~50 MB/s)
- RADAR + GPS/IMU + Vehicle Bus (~10 MB/s)
- Total Data Rate: ~$460\text{ MB/s per vehicle} \approx 1.65\text{ TB/hour}$.
- Daily Aggregation:
- Per vehicle daily volume: $1.65\text{ TB/hr} \times 8\text{ hrs} \approx 13.2\text{ TB/day}$.
- Entire fleet daily volume: $1,000 \times 13.2\text{ TB} = 13.2\text{ Petabytes/day}$.
- Network & Bandwidth Constraints:
- Uploading 13.2 TB over 5G cellular is cost-prohibitive and unreliable.
- Primary raw log offloading must occur at physical depots via 10GbE local links or physical NVMe array hot-swaps.
- Cellular is reserved exclusively for high-priority operational telemetry, GPS heartbeats, metadata, and urgent road change flags (~10 KB/s per vehicle).
2. High-Level Architecture
+-----------------------------------+
| Vehicle Fleet (1,000) |
+-----------------------------------+
/ \
Cellular (MQTT) / \ Physical Transfer
(Telemetry/Health/Meta)/ \ (Depot Wi-Fi / NVMe Swap)
v v
+-------------------------------+ +-------------------------------+
| Ingestion API / Edge Broker | | Depot Ingest Station |
+-------------------------------+ +-------------------------------+
| |
v v
+-------------------------------+ +-------------------------------+
| Kafka Metadata Stream | | Raw Data Staging Bucket |
+-------------------------------+ +-------------------------------+
| |
+----------------------+----------------------+
|
v
+----------------------------+
| Processing Orchestrator |
| (Apache Airflow/Temporal)|
+----------------------------+
|
+-------------------+-------------------+
| |
v v
+------------------------------------+ +------------------------------------+
| Validation & Quality Checker | | PII Masking & Privacy Pipeline |
| (GPS Sync, Sensor Health, Blur) | | (YOLO/Vision Models + Anonymizer) |
+------------------------------------+ +------------------------------------+
| |
+-------------------+-------------------+
|
v
+----------------------------+
| Indexed Data Platform |
| (Parquet + Apache Iceberg) |
+----------------------------+
|
+-------------------+-------------------+
| |
v v
+------------------------------------+ +------------------------------------+
| Coverage Engine & Mission Planner | | Downstream Map Building Pipeline |
+------------------------------------+ +------------------------------------+
3. Key Subsystem Designs
A. Route Planning & Coverage Engine
To avoid redundant driving and ensure high-definition maps remain fresh:
- Spatial Representation: Map the target road network using Google S2 (Level 13/14) or Uber H3 (Level 9/10) hexagonal grids.
- Staleness Scoring: Assign a score $S(r)$ to each road segment $r$: $$S(r) = w_1 \cdot \text{TimeSinceLastDrive} + w_2 \cdot \text{ReportedChanges} + w_3 \cdot \text{MapUncertainty}$$
- Mission Dispatch:
- A Coverage Master Service generates daily target route topologies by minimizing travel time between high-priority, out-of-date spatial cells.
- Route packages are pushed to vehicle head units over cellular during off-peak hours.
B. Dual-Mode Offloading Strategy
- On-Vehicle Edge Storage: Raw Rosbag2/MCAP container formats are logged to a RAID-0 NVMe storage array onboard the vehicle.
- Metadata Sync (Cellular - Real-time):
- Telemetry (Location, Velocity, System Temps, Storage Capacity) is sent via MQTT every 5 seconds.
- Encountered flags (e.g., active construction zone detected on edge camera) are sent immediately.
- Bulk Ingestion (Depot - End of Shift):
- Option 1: Direct 10 Gbps Ethernet tethering when the vehicle docks.
- Option 2: Driver pulls out a ruggedized multi-TB NVMe cartridge and inserts it into a depot rack station.
- Data is pushed to standard Cloud Object Storage (e.g., AWS S3 / Google Cloud Storage) staging buckets with checksum validation (MD5/SHA-256) to ensure 100% integrity before wiping the vehicle disk.
C. Validation, Quality Gating & Data Scrubbing
Raw data cannot be used directly; it must undergo automated quality verification:
- Temporal & Spatial Alignment: Verify hardware-level PTP (Precision Time Protocol) cross-sensor synchronization between LiDAR sweeps and camera frames. Check for GPS signal dropouts (RTK lock loss in urban canyons).
- Environmental & Scene Quality: Run lightweight ML models to detect heavy rain, fog, lens occlusions, or extreme sun glare that invalidates optical data.
- Privacy Sanitization:
- Run specialized object detection models to mask human faces and vehicle license plates.
- Strip sensitive metadata outside designated collection geofences.
D. Data Layout & Metadata Schema
Data is transformed into spatial-temporally optimized columnar formats (Apache Parquet / Apache Iceberg) stored in object storage.
Spatial Index Metadata Table (segment_coverage)
CREATE TABLE segment_coverage (
h3_index VARCHAR(15), -- Spatial grid cell ID
road_segment_id UUID, -- Unique road segment identifier
last_collected_at TIMESTAMP,
collection_pass_count INT,
quality_score FLOAT, -- Aggregate rating based on weather/lighting/sync
PRIMARY KEY (h3_index, road_segment_id)
);
Sensor Log Registry (vehicle_drives)
CREATE TABLE vehicle_drives (
drive_id UUID PRIMARY KEY,
vehicle_id VARCHAR(64),
start_time TIMESTAMP,
end_time TIMESTAMP,
raw_storage_uri VARCHAR(512), -- s3://ingest-bucket/raw/2026/03/31/drive_123/
processed_storage_uri VARCHAR(512), -- s3://clean-bucket/2026/03/31/drive_123/
ingest_status VARCHAR(32), -- STAGED, VALIDATED, ANONYMIZED, FAILED
total_bytes BIGINT
);
4. Deep Dive Trade-offs & Critical Engineering Challenges
1. Cellular vs. Physical Depot Offload
- Cellular Transmission: Allows real-time map updates but is bounded by carrier bandwidth cost. At ~13 TB/vehicle/day, cellular upload cost for a 1,000-vehicle fleet would exceed millions of dollars monthly.
- Hybrid Approach (Selected): Upload lightweight feature vectors, low-resolution snapshots, and GPS logs over 5G. Stream full uncompressed raw point clouds and 4K video only via physical depot links.
2. Stream Ingestion Bottlenecks & Deduplication
- Multi-petabyte ingestion creates backend bottlenecks during shift-change hours when hundreds of vehicles return simultaneously to the depot.
- Mitigation: Deploy local depot storage buffers (NAS) acting as edge caching proxies. Depot uploaders throttling rate-limit object storage uploads based on regional cloud ingestion limits.
3. Handling Poor Quality Runs
- Data collected in extreme weather (e.g., heavy snow covering lane markers) or during camera hardware failures must not pollute HD map construction pipelines.
- Mitigation: Automated validation engines score drives. If
quality_score < threshold, the data is routed to cold/archive storage, and a new collection mission for that spatial cell is re-queued automatically in the Coverage Engine.
5. Summary Checklist
| Dimension | Architectural Choice |
|---|---|
| Ingestion Protocol | MQTT for real-time telemetry over Cellular; rsync/s3-accelerate over 10GbE for Depot transfers |
| Spatial Indexing | Uber H3 / Google S2 for partitioning coverage maps and mission targets |
| Processing Pipeline | Temporal/Airflow orchestrating Spark/C++ microservices for validation and privacy masking |
| Storage Layer | Blob Storage (S3/GCS) + Apache Iceberg catalog for multi-PB querying |
| Data Quality Gate | Automated PTP timestamp verification, RTK GPS lock audit, and vision occlusion checks |