GrabChao WangProblem & solution
Automatic rule backtesting with large quantities of data
Summary
Evaluating new or modified risk rules previously required Grab analysts to run slow offline Presto queries, manually construct payloads, or run rules in shadow mode for days. To standardize and accelerate this workflow, Grab developed an automated backtesting system powered by an AWS EMR Spark pipeline. Historical events are continuously ingested via Kafka and a Kubernetes stream pipeline into S3 using Snappy-compressed Parquet. Users configure replay intervals and rule definitions directly in the rule engine UI, which triggers asynchronous Spark jobs through Amazon SQS and Lambda. This automated simulation replaces multi-week shadow mode runs and generates downloadable aggregation metrics on transactions, user counts, and treatment outcomes.
Context
Testing rule performance across teams was unstandardized, inaccurate, and slow, relying on disjointed Presto queries, manual payload setups, or days of shadow-mode execution across different rule engines.
Approach / What changed
Building a Spark-based backtesting pipeline on AWS EMR triggered from a rule engine UI via SQS and Lambda to replay rule logic against historical Kafka events stored in S3.
Takeaways
Replaying historical event data via Spark pipelines eliminated the need for multi-day shadow mode testing, saving weeks in the rule onboarding cycle.
Streaming trust inference events into dedicated S3 buckets via Kubernetes pipelines improved processing efficiency and avoided data lake delays.
Relying on data engineers to write underlying Spark analytics created a bottleneck, motivating the future development of a domain-specific language for self-service rule configuration.
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.