---
title: "Building a Real-time Buyer Signal Data Pipeline for Shopify Inbox"
description: "Shopify built a streaming pipeline on Apache Beam and Google Cloud Dataflow that surfaces cart actions and order completions to merchants inside Shopify Inbox conversations."
url: "https://swe.quest/articles/building-a-real-time-buyer-signal-data-pipeline-for-shopify-inbox-35ea4cdd28145f71"
canonical: "https://shopify.engineering/real-time-buyer-signal-data-pipeline-shopify-inbox"
source: "Shopify Engineering"
published: "2021-12-13"
difficulty: "medium"
kind: "Case study"
reading_minutes: 12
tags: ["stream-processing","data-pipelines","event-driven","ecommerce"]
---

# Building a Real-time Buyer Signal Data Pipeline for Shopify Inbox

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2021-12-13, 12 min read, Case study. Original: [https://shopify.engineering/real-time-buyer-signal-data-pipeline-shopify-inbox](https://shopify.engineering/real-time-buyer-signal-data-pipeline-shopify-inbox)

## Summary

Shopify built a streaming pipeline on Apache Beam and Google Cloud Dataflow that surfaces cart actions and order completions to merchants inside Shopify Inbox conversations. Kafka inputs (Monorail and Debezium CDC from MySQL) are filtered, keyed by buyer token with CoGroupByKey, and aggregated in a Global Window. Stateful processing compares timestamps to drop out-of-order events, derives cart actions from quantity changes, clears cart state on checkout, and uses event-time timers to expire state. In an A/B test, merchant response rate rose 2 percentage points and conversation conversion rate rose 0.7 points, with no change in response time.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Stream processing](https://swe.quest/tags/stream-processing.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Event-driven architecture](https://swe.quest/tags/event-driven.md) (Backend & APIs)
- [E-commerce](https://swe.quest/tags/ecommerce.md) (Domains)

## Prerequisites

- Apache Beam windowing and state ([easy posts on Elixir & Erlang](https://swe.quest/tags/elixir-erlang.md?difficulty=easy))
- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- stream processing concepts ([easy posts on Stream processing](https://swe.quest/tags/stream-processing.md?difficulty=easy))

## Keywords

Apache Beam, Google Cloud Dataflow, Apache Kafka, Debezium, Monorail, Shopify Inbox

## Related posts

- [How Shopify Built An In-Context Analytics Experience](https://swe.quest/articles/how-shopify-built-an-in-context-analytics-experience-bced6498ed610bad.md): Shopify Engineering · 2021-05-25 · Medium · 14 min read · Analytics & OLAP, Data pipelines, Product engineering, Stream processing, E-commerce
  Shopify embedded order and fulfillment metrics directly into the admin Orders page instead of keeping them in a separate Analytics section, after research showed merchants bouncing between pages to make decisions.
- [From batch processing to streaming: AMP’s data journey from open-source to ClickHouse Cloud](https://swe.quest/articles/from-batch-processing-to-streaming-amp-s-data-journey-from-open-source-to-2056cdf52d7c0f11.md): ClickHouse · 2025-01-20 · Medium · 5 min read · Analytics & OLAP, Data pipelines, Stream processing, E-commerce
  AMP, a Shopify analytics platform, replaced a brittle twice-daily Postgres-to-ClickHouse batch sync, which routinely left data 30 to 72 hours stale and needed a 1.2 TB RAM server, with a streaming pipeline into ClickHouse Cloud.
- [How Shopify improved consumer search intent with real-time ML](https://swe.quest/articles/how-shopify-improved-consumer-search-intent-with-real-time-ml-15d46e89bc4248e9.md): Shopify Engineering · 2024-10-18 · Medium · 8 min read · Inference & serving, Stream processing, ML platforms, Search, Cost optimization
  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.
- [Scaling Shopify's BFCM Live Map: An Apache Flink Redesign](https://swe.quest/articles/scaling-shopify-s-bfcm-live-map-an-apache-flink-redesign-bcbe156fa7990bd0.md): Shopify Engineering · 2021-12-10 · Medium · 9 min read · Stream processing, Scaling, System design, Real-time systems
  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.
- [Real-time event streaming with ClickHouse, Confluent Cloud and ClickPipes](https://swe.quest/articles/real-time-event-streaming-with-clickhouse-confluent-cloud-and-clickpipes-879faea273bbaac2.md): ClickHouse · 2023-07-20 · Medium · 7 min read · Stream processing, Queues & messaging, Analytics & OLAP, Data pipelines
  ClickPipes, a managed Kafka ingestion service in ClickHouse Cloud, replaces the ClickHouse Kafka Connector in a pipeline that streams Google's public Ethereum dataset from Pub/Sub through Confluent Cloud into ClickHouse.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
