Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Grab Engineering 8 min read Case study easyNovice

The journey of building a comprehensive attribution platform

Grab's ads and promo attribution system evolved from a Kappa-architecture streaming engine to a Lambda architecture that pairs real-time stream processing with Spark batch jobs over S3. The pure streaming design cut attribution latency from 2-3 days to minutes, but it struggled with processing cost, long attribution windows, out-of-order events and multi-touch models. Adding an offline batch layer gave historical context and fault tolerance, kept discrepancies under 1% and cut real-time processing costs by about 25%. To limit the cost of maintaining two codebases, Grab plans to reserve the real-time path for time-sensitive metrics such as cost-per-order budget capping and move all other reporting to batch.

Related posts

  • Rebuilding Guardian: How Pinterest Upgraded Its Real-Time Abuse Platform to Modern Infrastructure…

    Pinterest Engineering mediumAdept

    Pinterest rebuilt Guardian, its real-time abuse detection platform, from a monolithic in-house system into a modular V2 that separates interactive analytics, continuous action evaluation and historical replay. A thin ANTLR4-based translator keeps a single GSQL V2 interface for users, compiling queries to StarRocks SQL for investigation and to FlinkSQL for async actions. Stream splitting and pruning of enriched events into event-family substreams cut indexed column scale from O(20K) to O(K). StarRocks duplicate-key tables, sort keys and Bloom filter indexes bring some lookups to sub-second latency. Replay runs on the same FlinkSQL execution model over Iceberg datasets, which also moves data into governed storage.

  • How AdGreetz Processes Millions of Daily Ad Impressions with ClickHouse Cloud

    ClickHouse easyNovice

    AdGreetz moved its ad impression analytics from AWS Athena to Snowflake and then to ClickHouse Cloud, citing roughly six times lower cost than a small Snowflake standard plan and sub-second rather than multi-second queries. The pipeline ingests 5-6 million impressions a day, peaking at 20-30 million, through Cloudflare Workers. The workers acknowledge each event, enrich it in the background, and insert JSON over HTTP using async inserts, so no Kafka buffering layer is needed. Data is partitioned by time, aggregated with materialized views, isolated per customer with filtering views, and served to partners through Metabase dashboards.

  • Scaling Shopify's BFCM Live Map: An Apache Flink Redesign

    Shopify Engineering mediumAdept

    Shopify scaled its Black Friday/Cyber Monday live sales map by putting Apache Flink in front of Cricket, its home-grown Go stateful streaming service. Flink filtered the checkout Kafka stream so Cricket processed only about one percent of the events, and Flink also computed new metrics such as product trends and unique shoppers. The Flink jobs used cross-region sharding and active-active deployment, handled load tests of 1M events/sec and ran with 100% uptime through BFCM, with Spark batch jobs as a fallback. Redis used for broadcasting to browsers still became a bottleneck and briefly clogged in production, so the planned redesign moves all metrics into Flink and snapshots them to a store that a web tier serves from an in-memory cache.

  • How Shopify improved consumer search intent with real-time ML

    Shopify Engineering mediumAdept

    Shopify generates about 2,500 text and image embeddings per second (216M/day) in near real time with Google Cloud Dataflow and Apache Beam's RunInference on T4 GPUs, feeding Storefront Semantic Search and a BigQuery warehouse. Cutting Dataflow's per-process worker harness threads from 12 to 4 reduced memory use about 2.6x, from roughly 104GB to 40GB, without hurting GPU-bound throughput. That let the team drop high-memory machines and save 14% in cost. Sharing one model across processes and forcing a single SDK container both hurt throughput too much. Bursty input produced bundles of one element, so in-bundle batching rarely formed real batches, but stateful cross-bundle batching added unacceptable shuffle latency; per-process model copies still keep the GPU saturated.

  • How InMobi achieved 20x faster queries and 80% cost savings with ClickHouse

    ClickHouse mediumAdept

    InMobi moved its publisher-facing real-time ad reporting APIs from a serverless warehouse on blob storage to ClickHouse. P99 latency at peak dropped from over 60s to under 3s, and monthly cost fell from $40K to $8K. The workload is 400K+ daily queries over 10 TB of uncompressed data, which compresses to about 500 GB. Key engineering choices include: - hourly Spark ingestion into staging tables, validated and then promoted atomically via MOVE PARTITION to avoid duplicates from retries - isolated reader and ephemeral writer compute over shared storage - gevent-based async connection handling to fix OOMs caused by per-session memory overhead - automatic fallback to the old platform when failures exceed 2% in a 5-minute window Cost now scales in steps with added replicas, each adding about 30% capacity, rather than linearly with traffic.

The quest for software engineering knowledge.

Look:
Layout: