CacheU
Design

Design a Real-Time Location Tracking System for Ride-Hailing and Delivery Platforms

A complete production-grade high-level design for a real-time location tracking system like Uber, Zomato, or Grab, covering GPS ingestion, live location streaming, driver and rider tracking, ETA computation, map matching, geofencing, dispatch, caching, event streaming, multi-region scale, and fault tolerance.

Ride-hailing and delivery platforms live or die by one capability:

knowing where the driver, rider, or delivery partner is right now, and doing it at scale.

That sounds simple.

But in production, real-time location tracking is one of the hardest parts of the system because it must handle:

  • frequent GPS updates
  • poor network conditions
  • battery constraints on mobile devices
  • millions of simultaneous moving devices
  • ETA computation
  • dispatch and matching
  • geofencing
  • map matching
  • driver lifecycle tracking
  • low-latency UI updates
  • fallback behavior when GPS is weak
  • real-time state consistency
  • regional traffic and scale
  • fraud detection and spoofed location signals

This is the core backend capability behind:

  • Uber driver tracking
  • Grab cab and rider live tracking
  • Zomato delivery partner tracking
  • food courier movement
  • pilot or field-agent tracking
  • fleet management systems
  • logistics dispatch systems

The system is not just “send latitude and longitude.”

The system must answer:

  • Where is the driver right now?
  • How fresh is that location?
  • Is the driver on the route?
  • How far from pickup?
  • What is the ETA?
  • Should the customer see the current state?
  • Is the device spoofing its location?
  • Which nearby drivers are eligible for dispatch?
  • Which geofence does this device belong to?
  • What is the best update rate to use?

A real-time tracking platform is therefore a streaming location intelligence system.


1. Problem Statement

Design a real-time tracking system where riders, dispatchers, or customers can see the live location of:

  • drivers
  • delivery partners
  • pilots
  • fleet vehicles
  • service agents
  • couriers

The platform should support:

  • live location updates
  • near real-time map visualization
  • accurate ETA
  • driver movement history
  • geofence detection
  • route deviation alerts
  • dispatch integration
  • offline buffering
  • map matching
  • fraud/spoof detection
  • multi-region scale

2. Functional Requirements

RequirementDescription
Live TrackingShow current location of moving entity
Frequent UpdatesReceive location every few seconds
ETA CalculationEstimate arrival time dynamically
GeofencingDetect entry/exit of zones
Dispatch SupportHelp match nearest available driver
Movement HistoryStore location trail
Map MatchingSnap raw GPS to roads/routes
Live UI UpdatesPush location updates to consumers
Battery EfficiencyAvoid draining mobile devices too fast
Spoof DetectionDetect fake GPS locations
Offline HandlingBuffer updates if network is poor
Multi-Region ScaleTrack millions of moving devices

3. Non-Functional Requirements

RequirementTarget
LatencySub-second or near real-time
Availability99.99%
ScalabilityMillions of active tracked entities
AccuracyGood enough for street-level visibility
DurabilityPreserve event history
Fault ToleranceSurvive packet loss and reconnects
SecuritySecure transport and auth
Battery EfficiencyMobile apps must conserve power
ObservabilityDebugging and replay support
Cost EfficiencyMinimize unnecessary update processing

4. Why This Is a Hard Problem

A simple tracking toy system might just store the latest location.

A real system must do much more.

It must handle:

  • thousands of updates per second per city during peak hours
  • varying GPS quality
  • route snapping
  • delayed packets
  • duplicate updates
  • outdated coordinates
  • device offline/reconnect cycles
  • delivery state transitions
  • map rendering for thousands of users
  • matching logic for supply and demand

The most important challenge is that location is a high-frequency time-series signal.

That means:

  • lots of writes
  • lots of reads
  • lots of derived state
  • lots of freshness concerns

5. High-Level Architecture

Diagram
flowchart TB ClientApp[Driver / Courier Mobile App] RiderApp[Rider / Customer App] Dispatcher[Dispatcher / Ops Panel] PartnerApp[Pilot / Fleet App] APIGW[API Gateway] Auth[Auth Service] TrackingSvc[Tracking Service] LocationIngest[Location Ingest Service] StreamProc[Stream Processor] GeoSvc[Geofence Service] ETASvc[ETA Service] MatchSvc[Dispatch / Matching Service] RealtimeGW[WebSocket / Realtime Gateway] HistorySvc[Movement History Service] FraudSvc[Spoof Detection Service] MapSvc[Map Matching Service] NotifySvc[Notification Service] Redis[(Redis / Geo Cache)] Kafka[(Kafka / Event Bus)] LocationDB[(Latest Location Store)] HistoryDB[(History DB)] GeoIndex[(Geospatial Index)] RouteDB[(Route / Map Data)] AuditDB[(Audit / Fraud Log)] Analytics[(Analytics Warehouse)] ClientApp --> APIGW RiderApp --> APIGW Dispatcher --> APIGW PartnerApp --> APIGW APIGW --> Auth APIGW --> TrackingSvc APIGW --> MatchSvc APIGW --> ETASvc APIGW --> RealtimeGW TrackingSvc --> LocationIngest LocationIngest --> Kafka Kafka --> StreamProc StreamProc --> GeoSvc StreamProc --> MapSvc StreamProc --> FraudSvc StreamProc --> HistorySvc StreamProc --> ETASvc StreamProc --> RealtimeGW StreamProc --> LocationDB StreamProc --> Redis StreamProc --> GeoIndex StreamProc --> HistoryDB StreamProc --> AuditDB StreamProc --> Analytics MapSvc --> RouteDB GeoSvc --> GeoIndex ETASvc --> RouteDB MatchSvc --> Redis NotifySvc --> Kafka

6. Core Design Philosophy

A production tracking system must separate:

ConcernBest Layer
Latest current locationRedis / hot store
Historical trailTime-series / history DB
Event streamKafka
Geofence checksStream processor
ETA computationRouting + traffic service
UI updatesWebSocket gateway
Fraud detectionRules + stream analytics
Route snappingMap matching service

The golden rule is:

Store the latest state fast, and store the history durably.


7. Update Frequency and Battery Strategy

A location tracking system cannot blindly request GPS every second forever.

That would destroy:

  • battery life
  • mobile data
  • backend capacity

The right update frequency depends on context:

ContextUpdate Frequency
Driver on active tripEvery 1–3 seconds
Idle driverEvery 10–30 seconds
Delivery partner on routeEvery 2–5 seconds
Pilot/fleet trackingDepends on movement speed
Stopped vehicleEvent-driven or low-frequency

The client should adapt based on:

  • speed
  • app state
  • battery level
  • trip status
  • network quality

8. GPS Ingestion Flow

The mobile app captures location periodically and sends it to the backend.

Diagram
sequenceDiagram participant App as Driver App participant API as Ingest API participant Kafka as Kafka participant Proc as Stream Processor participant Redis as Redis participant Rider as Rider App App->>API: Send GPS update API->>Kafka: Publish location event Kafka->>Proc: Consume event Proc->>Redis: Update latest location Proc->>Rider: Push live update

9. Location Event Schema

A robust location event should carry more than lat/lon.

FieldPurpose
entity_idDriver / rider / agent / vehicle
trip_idTrip context
timestampEvent time
latitudeGPS latitude
longitudeGPS longitude
accuracyGPS accuracy radius
speedMovement speed
headingDirection
altitudeOptional for special use cases
battery_levelBattery context
sourceGPS / network / fused
device_idDevice identity
sequence_noDeduplication and ordering
odometerOptional distance signal

10. Why Accuracy Matters

Raw GPS data is noisy.

A point may be:

  • off by 5 meters
  • off by 50 meters
  • distorted by buildings
  • stale due to network delay

So the backend should not always trust the raw coordinate as the final truth.

Instead:

  • validate it
  • smooth it
  • map match it
  • compare it against route history
  • estimate if it is plausible

11. Latest Location Store

The system needs a very fast way to answer:

Where is driver D right now?

This is a hot read.

A relational DB is too slow for this use case.

Use:

  • Redis
  • in-memory cache
  • geospatial index
  • hot replicated store

Latest Location Model

FieldPurpose
entity_idUnique tracked object
latitudeCurrent lat
longitudeCurrent lon
updated_atLast update time
speedCurrent speed
headingDirection
accuracyGPS confidence
trip_idActive trip
statusidle / on_trip / offline
zone_idOptional geofence
versionFor ordering

12. Redis as Hot State

Redis is ideal for the latest location because it is:

  • fast
  • in-memory
  • easy to update
  • easy to query by key

Example:

driver:123 -> {lat, lon, updated_at, speed, heading}

For geo queries:

  • nearest drivers
  • pickup radius checks
  • driver clustering

use geospatial indexes or geohash-based partitioning.


13. Geospatial Indexing

The system should support queries like:

  • find nearby drivers within 3 km
  • find couriers inside a delivery zone
  • find all pilots in a holding area
  • find vehicles inside a geofence

This requires geospatial indexing.

Common approaches:

  • geohash
  • H3
  • S2
  • R-tree
  • quadtree

A common practical choice is:

  • geohash for bucketing
  • Redis GEO commands or equivalent
  • secondary spatial filtering for precision

Nearby Search Diagram

Diagram
flowchart LR Rider[Rider Request] --> Search[Geo Search] Search --> Bucket1[Geohash Bucket A] Search --> Bucket2[Geohash Bucket B] Search --> Bucket3[Geohash Bucket C] Bucket1 --> Candidates[Nearby Drivers] Bucket2 --> Candidates Bucket3 --> Candidates

14. Dispatch and Matching

The tracking system is often linked to dispatch.

A rider requests a ride or a customer places an order.

The system then:

  • finds nearby eligible drivers
  • scores them based on proximity, availability, acceptance rate, ETA, vehicle type
  • dispatches to the best candidate

Matching Flow

Diagram
sequenceDiagram participant Rider as Rider App participant Match as Matching Service participant Geo as Geo Cache participant Driver as Driver App Rider->>Match: Request trip/order Match->>Geo: Find nearby entities Geo-->>Match: Candidate drivers Match->>Driver: Dispatch request Driver-->>Match: Accept/Reject

15. ETA Computation

ETA is not just distance divided by speed.

Real ETA should consider:

  • traffic
  • road geometry
  • turn delays
  • current route
  • pick-up behavior
  • signalized intersections
  • historical city speed patterns
  • driver behavior

ETA Inputs

InputWhy It Matters
Current locationBaseline distance
Route polylineActual road path
Traffic speedRealistic travel time
Road typeHighway vs local road
Pickup stop timeHuman interaction delay
Historical patternsTime-of-day correction

16. ETA Pipeline

Diagram
flowchart LR Location[Current Location] --> Route[Route Engine] Traffic[Traffic Feed] --> Route History[Historical Speed Data] --> Route Route --> ETA[ETA Service] ETA --> RiderUI[Rider UI]

17. Map Matching

GPS points often do not lie exactly on roads.

Map matching takes raw GPS and snaps it to the most likely road segment.

This improves:

  • UI accuracy
  • route visualization
  • ETA calculation
  • fraud detection
  • trip replay

Map Matching Flow

Diagram
flowchart TD RawGPS[Raw GPS Point] --> CandidateRoads[Candidate Road Segments] CandidateRoads --> ProbabilisticMatch[Best Match] ProbabilisticMatch --> SnappedPoint[Snapped Route Point]

A good map matching service uses:

  • road network graph
  • heading
  • historical trajectory
  • speed plausibility
  • confidence scoring

18. Geofencing

Geofences are important for:

  • airport pickup zones
  • delivery service areas
  • warehouses
  • no-parking zones
  • trip completion zones
  • fleet depots
  • city boundaries

The system must detect:

  • enter fence
  • exit fence
  • stay inside fence
  • dwell time inside fence

Geofence Flow

Diagram
flowchart LR GPS[Location Event] --> Fence[Geofence Engine] Fence -->|Enter| Enter[Zone Enter Event] Fence -->|Exit| Exit[Zone Exit Event] Fence -->|Inside| Inside[Stay Event]

19. Real-Time Update Delivery

The customer or dispatcher must see live movement.

Polling is inefficient.

Use WebSockets or server-sent events.

Diagram
flowchart LR LocationUpdate[New Location Event] --> RealtimeGW[Realtime Gateway] RealtimeGW --> CustomerApp[Customer App] RealtimeGW --> OpsDashboard[Dispatcher Dashboard]

The live UI should update smoothly without overloading the backend.


20. Why WebSockets Are Better Than Polling

Polling causes:

  • high request volume
  • wasted bandwidth
  • stale UX
  • expensive infrastructure

WebSockets provide:

  • lower latency
  • push-based updates
  • better user experience
  • lower repeated request overhead

21. Event Streaming Backbone

This system should be event-driven.

Kafka or a similar bus should carry:

  • location updates
  • trip state changes
  • geofence events
  • ETA updates
  • fraud signals
  • dispatch events
  • alert events
Diagram
flowchart LR Ingest[Location Ingest] --> Kafka[(Kafka)] Kafka --> Geo[Geofence Worker] Kafka --> ETA[ETA Worker] Kafka --> Fraud[Fraud Worker] Kafka --> History[History Writer] Kafka --> Realtime[Realtime Fanout]

22. Why Kafka Helps

Kafka absorbs spikes and decouples services.

This is especially valuable when:

  • thousands of drivers reconnect at once
  • a city becomes busy
  • many trips start simultaneously
  • a fleet of couriers comes online after a shift change

It protects the rest of the system from overload.


23. Location History

You need a historical trail for:

  • trip replay
  • customer support
  • fraud investigation
  • route analytics
  • ETA improvement
  • driver performance analysis

A history store should be append-only and partitioned by:

  • trip_id
  • entity_id
  • time window

History Flow

Diagram
flowchart LR LocationEvent --> HistoryWriter[History Writer] HistoryWriter --> HistoryDB[(History DB)] HistoryDB --> Replay[Trip Replay / Analytics]

24. Trip Replay

Trip replay is useful for:

  • support disputes
  • proof of delivery
  • route audits
  • incident investigations

The replay system reconstructs the entity’s movement over time.


25. Spoof and Fraud Detection

Some drivers or agents may spoof GPS.

You should detect:

  • impossible jumps
  • teleports across the city
  • inconsistent speed
  • mock location apps
  • unrealistic heading changes
  • repeated identical coordinates
  • stale device timestamps

Fraud Detection Pipeline

Diagram
flowchart LR GPS[Location Events] --> Rules[Rule Engine] GPS --> ML[Anomaly Model] Rules --> Flag[Flag Suspicious Device] ML --> Flag Flag --> Ops[Operations Review]

26. Device Heartbeats

A moving entity should send periodic heartbeats even when not moving.

Heartbeat signals help determine:

  • device online status
  • app health
  • stale location updates
  • background app reliability

Heartbeat Flow

Diagram
sequenceDiagram participant App participant Ingest participant StatusDB loop Every few seconds App->>Ingest: Heartbeat + location or keepalive Ingest->>StatusDB: Refresh online state end

27. Offline Buffering

Mobile networks are unreliable.

The app should buffer location updates locally when offline and send them later.

But stale updates should be handled carefully.

The backend should:

  • reject obviously outdated points
  • apply ordering via sequence numbers
  • store late events in history, not hot state
  • use only fresh points for live display

28. Update Ordering and Idempotency

Location events may arrive:

  • out of order
  • duplicated
  • delayed
  • retried

The backend must enforce ordering using:

  • event timestamp
  • sequence numbers
  • monotonic versioning
  • last-write-wins for live state
  • append-only history for audit

Ordering Logic

Diagram
flowchart TD Event[Incoming Location Event] --> Check[Check Sequence / Timestamp] Check --> Old{Older than latest?} Old -->|Yes| HistoryOnly[Store in History Only] Old -->|No| UpdateLive[Update Latest State]

29. Sharding Strategy

A location system must scale by geography.

Sharding dimensions can include:

  • city
  • region
  • geohash
  • vehicle type
  • tenant
  • trip zone

A common strategy:

  • route by city/region first
  • then geospatial buckets within region

This improves locality and reduces cross-region traffic.


Geo Sharding Diagram

Diagram
flowchart LR Router[Location Router] Router --> City1[City Shard A] Router --> City2[City Shard B] Router --> City3[City Shard C]

30. Why Geography-Based Sharding Works

Because most tracking queries are local.

Examples:

  • nearby drivers
  • nearby delivery partners
  • live ride tracking in one city
  • zone-based fleet analytics

Geographic locality helps:

  • reduce latency
  • improve cache efficiency
  • keep location writes and reads in the same zone

31. Caching Strategy

Cache:

  • latest location
  • active trip state
  • nearby candidates
  • ETA results
  • geofence membership
  • route summary
  • dispatcher view models
Diagram
flowchart TB Client --> App App --> Redis[(Redis Cache)] Redis --> DB[(Durable Store)]

The cache should store only current and hot state.

History belongs elsewhere.


32. Driver App Battery Optimization

The mobile app should reduce battery drain by:

  • increasing sampling interval when idle
  • decreasing sampling when stationary
  • using fused location provider
  • sending only significant movement deltas
  • batching events
  • compressing payloads
  • using efficient background sync

This is critical for delivery and driver adoption.


33. Zone-Based Updates

Not every location change deserves a UI update.

If a driver moves 5 meters inside a neighborhood, that may not matter.

A backend can reduce noise by:

  • only pushing if movement exceeds a threshold
  • batching very frequent updates
  • smoothing jitter
  • throttling UI updates

This keeps the map readable and reduces fanout load.


34. Dispatch and Supply Intelligence

Location tracking is not just for display.

It also powers:

  • driver availability
  • supply estimation
  • hotspot detection
  • surge or demand balancing
  • routing to pickup points

This is why the tracking system often feeds directly into dispatch logic.


35. Live Map View

The customer-facing map often shows:

  • live moving marker
  • route polyline
  • ETA
  • pickup point
  • drop point
  • driver icon orientation
  • current status

The UI should not request the full track every second.

Instead:

  • load initial trip summary
  • receive live deltas
  • update only changed fields

36. Real-Time Trip Timeline

A trip or delivery has states such as:

  • assigned
  • accepted
  • arrived at pickup
  • pickup completed
  • en route
  • delivered
  • cancelled
  • completed

The tracking system should understand this state machine.


Trip State Diagram

Diagram
stateDiagram-v2 [*] --> Assigned Assigned --> Accepted Accepted --> ArrivedAtPickup ArrivedAtPickup --> PickedUp PickedUp --> EnRoute EnRoute --> Delivered Assigned --> Cancelled Accepted --> Cancelled PickedUp --> Cancelled Delivered --> [*] Cancelled --> [*]

37. Use Cases Beyond Ride-Hailing

The same architecture can power:

  • food delivery
  • courier tracking
  • medical supply tracking
  • fleet management
  • airport pilot or ground vehicle tracking
  • field worker tracking
  • logistics dispatch
  • security patrol tracking

The core system remains the same:

  • ingest live movement
  • update latest state
  • derive route intelligence
  • stream to consumers

38. API Design


Send Location Update

POST /tracking/location

Request:

{
  "entityId": "driver_123",
  "tripId": "trip_555",
  "latitude": 12.9716,
  "longitude": 77.5946,
  "accuracy": 8,
  "speed": 14.2,
  "heading": 240,
  "timestamp": 1730000000,
  "sequenceNo": 991
}

Get Latest Location

GET /tracking/location/{entityId}

Get Trip History

GET /tracking/history/{tripId}

Get Nearby Drivers

GET /tracking/nearby?lat=12.97&lon=77.59&radius=3000

Subscribe to Live Tracking

GET /tracking/subscribe/{tripId}

39. Data Storage Strategy

DataRecommended Storage
Latest locationRedis / hot state store
Historical trackTime-series DB / NoSQL
Geofence rulesSQL / config DB
Route map dataMap graph store
Trip stateStrongly consistent DB
Real-time eventsKafka
AnalyticsData warehouse
Fraud logsAudit store

40. Consistency Model

The system needs different consistency levels for different data.

FeatureConsistency Requirement
Latest live locationNear real-time, last-write-wins
Movement historyEventual acceptable
Trip stateStrong consistency
Dispatch assignmentStrong consistency
Fraud flagsEventual acceptable
ETAEventual acceptable
Realtime map UINear real-time

This mixed consistency model is the only practical choice.


41. Multi-Region Architecture

A large platform should deploy by region.

Each region should have:

  • local ingest
  • local tracking cache
  • local realtime fanout
  • local dispatch decisions where possible

Cross-region replication should be used for:

  • analytics
  • global monitoring
  • backup/failover
  • admin visibility
Diagram
flowchart TB India[India Region] SEA[SEA Region] EU[Europe Region] US[US Region] India <--> GlobalSync[(Global Sync)] SEA <--> GlobalSync EU <--> GlobalSync US <--> GlobalSync

42. Failure Scenarios


GPS Stops Updating

Mitigation:

  • use last known location
  • mark entity stale after TTL
  • reduce UI confidence
  • trigger reconnect logic

Network Drops

Mitigation:

  • local buffering
  • reconnect
  • backfill history later

Kafka Lag

Mitigation:

  • scale consumers
  • prioritize live updates
  • separate hot and cold pipelines

Redis Failure

Mitigation:

  • replication
  • failover
  • rebuild latest state from event stream

Spoofed Location

Mitigation:

  • anomaly detection
  • velocity rules
  • device attestation
  • route plausibility checks

43. Observability

Track:

MetricWhy
Location ingest rateLoad level
Update latencyReal-time quality
Stale entity countHealth
Geo query latencyDispatch performance
ETA accuracyUser experience
Realtime push successMap freshness
Spoof detectionsFraud control

44. Monitoring Architecture

Diagram
flowchart TB Services --> Logs[(Logs)] Services --> Metrics[(Metrics)] Services --> Traces[(Traces)] Services --> Alerts[(Alerts)] Logs --> Dashboard[Operations Dashboard] Metrics --> Dashboard Traces --> Dashboard Alerts --> OnCall[On-call / Incident Response]

45. Advanced Optimizations

Adaptive Sampling

Increase or decrease update frequency based on:

  • movement speed
  • route phase
  • battery
  • network quality

Delta Compression

Send only changes rather than full payloads.

Map Region Partitioning

Keep geospatial processing local to a region.

Hot Path Split

Separate:

  • live map path
  • history path
  • analytics path

This prevents the live system from being slowed down by batch processing.


46. Final Production Architecture

Diagram
flowchart TB Driver[Driver / Courier / Pilot App] Rider[Customer / Dispatcher App] Gateway[API Gateway] Auth[Auth Service] Ingest[Location Ingest Service] Kafka[(Kafka)] Stream[Stream Processor] Geo[Geofence Service] ETA[ETA Service] Fraud[Fraud Detection] MapMatch[Map Matching] Realtime[Realtime Gateway] Match[Dispatch Service] Redis[(Redis Hot Store)] LatestDB[(Latest Location Store)] HistoryDB[(History DB)] GeoIndex[(Geo Index)] RouteDB[(Road Network / Routes)] Analytics[(Analytics Warehouse)] Driver --> Gateway Rider --> Gateway Gateway --> Auth Gateway --> Ingest Gateway --> Match Gateway --> Realtime Gateway --> ETA Ingest --> Kafka Kafka --> Stream Stream --> Redis Stream --> LatestDB Stream --> HistoryDB Stream --> Geo Stream --> ETA Stream --> Fraud Stream --> MapMatch Stream --> Realtime Stream --> Analytics Geo --> GeoIndex ETA --> RouteDB MapMatch --> RouteDB Match --> Redis

47. Tradeoffs

Design ChoiceBenefitTradeoff
Redis for latest stateUltra-fast readsMemory cost
Kafka event pipelineDecoupled processingOperational complexity
Time-series history DBDurable movement trailExtra storage layer
Geohash/H3 indexingFast nearby queriesSpatial tuning complexity
WebSocketsLive UIStateful connection management
Adaptive samplingBattery savingsLess granular data

48. Key Takeaways

ConceptSummary
Location trackingA streaming geospatial problem
Latest stateStore in hot cache
HistoryStore append-only
DispatchUse nearby geo queries
ETAUse routes + traffic + history
Map matchingSnap raw GPS to roads
GeofencingDetect zone entry and exit
Realtime UIUse WebSockets
Fraud detectionValidate location plausibility
Battery efficiencyAdaptive update rates

Conclusion

A real-time tracking system like Uber, Grab, or Zomato is much more than a map marker.

It is a high-frequency geospatial streaming platform that must continuously process live GPS data, keep the latest state hot, store complete history durably, compute ETAs, detect geofences, support dispatch, and deliver updates to many consumers in real time.

The correct architecture uses:

  • a location ingest pipeline
  • Kafka for buffering and event streaming
  • Redis for latest live state
  • history storage for trails and analytics
  • geospatial indexing for nearby queries
  • map matching for road accuracy
  • ETA service for route intelligence
  • WebSockets for live updates
  • fraud detection for spoof prevention
  • multi-region deployment for resilience
  • adaptive sampling for battery efficiency

The hardest part is not storing coordinates.

The hardest part is turning raw coordinates into trustworthy, low-latency, operationally useful location intelligence at scale.

That is what makes this a true production-grade system design problem.