All Projects
02Real-time mobility backendPersonal project

Ride-Sharing Platform (Go + gRPC)

High-Throughput Real-Time Mobility Architecture

Low-latency ride hailing in Go with Geohash driver matching, WebSocket live tracking, Stripe payments, and K8s deployment.

View source on GitHub
GogRPCMongoDBRedis GEOStripeK8s

Go Microservices

gRPC Protobuf

Redis GEO

Kubernetes HPA

The engineering problem

Core Challenge

Broadcasting real-time vehicle locations without overloading transactional databases.

Architecture Solution

Decoupled pings into Redis GEO + ephemeral WebSocket channels; only persist trip snapshots to MongoDB.

Resilience Guardrail

Auto-reconnect backoff with sequence numbers to eliminate duplicate location frames.

Service topology & IPC protocols

Driver Location Service

Ingests 10K/s GPS coordinates into Redis GEO

WebSocket / TCP

Matching Engine (Go)

Geohash radial proximity search (<10ms)

gRPC Protobuf

Trip Lifecycle Service

State machine managing requested/accepted/active

MongoDB Driver

Payment Dispatcher

Stripe payment intents & fare calculation

HTTPS / REST
  • Matching — geohash indexing for sub-10ms driver discovery
  • Location — WebSocket handling 10K+ coordinate updates
  • Payments — Stripe with webhook signature verification
  • Trips — state machine for ride lifecycles
  • Notifications — RabbitMQ fanout push

Canonical event / payload contract

application/json
{
  "tripId": "trip_901a88",
  "driverId": "drv_4421",
  "passengerId": "usr_9910",
  "coordinates": { "lat": 23.8103, "lng": 90.4125 },
  "geohash": "wh0r6t",
  "status": "ACCEPTED",
  "timestamp": 1788279120
}

Resilience & high availability

Sub-10ms Geohash Queries: Decoupled location updates from persistent disks into in-memory Redis GEO.
gRPC Binary Serialization: Protobuf serialization reduces network payload size by 65% compared to JSON.
Kubernetes Auto-Scaling: Horizontal Pod Autoscaler scales matching pods dynamically based on CPU/Memory thresholds.
WebSocket Heartbeat: Ping/pong frames with sequence tracking prevent zombie connections.
Ultra-fast Go with Protobuf gRPCRedis GEO radial queriesKubernetes HPA with probes