01 — Problem
What was hard about this
Ride-booking platforms face a fundamental race condition — two users at checkout for the same vehicle. Naive implementations either double-book and lose customer trust, or serialize every booking and kill throughput. Both are unacceptable.
02 — Solution
How it works
Microservices in Java Spring Boot split along bounded contexts (auth, bookings, payments, notifications). Row-level pessimistic locks on the vehicle-availability table serialize only conflicting bookings — browsing and reads stay parallel. Redis caches hot read paths (vehicle listings, session state) so the database isn't hammered by traffic that doesn't need a write. JWT with role-scoped RBAC isolates customer, driver, and admin permissions. Next.js handles the frontend with server-side data fetching.
03 — Impact
What shipped
- Concurrent ride-booking via row-level locks — no double-bookings under contention
- Sub-200ms reads via Redis caching of vehicle listings and sessions
- JWT/RBAC isolating customer, driver, and admin permission sets
- Bounded-context microservices: auth, bookings, payments, notifications