GrabSourabh SumanProblem & solution
Democratising Fare Storage at Scale Using Event Sourcing
Summary
Grab's legacy system stored booking and fare details in a single relational table, creating a bloated booking entity that tracked only the latest fare state and hindered rapid feature iteration. To resolve scalability, stability, and debugging challenges across millions of daily bookings, the team developed Fare Storage using the Event Sourcing pattern. The new architecture persists all fare modification events chronologically in DynamoDB, backed by a cache for eventually consistent reads and message streaming for downstream processing. The platform employs optimistic locking with versioning to manage concurrent updates, enforces idempotency through client-generated transaction UUIDs, and delegates metadata serialization to an SDK to prevent storage API changes.
Context
Storing booking and fare details within a single relational database table bloated Grab's booking entity, threatened scaling and stability across millions of daily bookings, made schema updates prohibitively expensive, and lacked an audit trail of fare modifications.
Approach / What changed
Building a decoupled Fare LifeCycle service using Event Sourcing backed by DynamoDB, utilizing optimistic locking for concurrency control, client-generated transaction UUIDs for idempotent retries, and client SDK-side metadata serialization into raw bytes.
Takeaways
Optimistic locking using incremented version numbers prevents race conditions during concurrent fare updates while offloading fare recalculation logic to client services.
Idempotent event processing is maintained by having the client SDK generate a unique transaction UUID per event, enabling the store to reject duplicate retry submissions.
Serializing metadata into raw bytes at the client SDK layer allows product teams to introduce new fee breakdowns without deploying updates to the central storage service.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.