How Shopify Built An In-Context Analytics Experience
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. The data science team validated candidate metrics against merchant workflows, segmented merchants to study the shape of each metric (hiding metrics that are inapplicable, constant, or only useful over long periods), and prototyped visualizations with real data. One result was choosing histograms over medians for fulfillment and delivery times. A shared data specification sheet kept Web, Android and iOS on the same queries. The underlying model uses an atomic grain of one row per fulfillment, in-transit or delivery event, and was built batch-first, then combined with streaming in a lambda architecture so batch supplies history and streaming covers recent data.
Related posts
- Introducing ShopifyQL: Our New Commerce Data Querying Language
Shopify Engineering easyNoviceShopifyQL is a commerce-focused query language for Shopify Plus merchants that reorders SQL-like syntax (FROM before SHOW, BY instead of GROUP BY) and adds VISUALIZE for direct charting, COMPARE TO for period-over-period analysis without joins or window functions, and DURING for named commerce date ranges like BFCM. It runs over purpose-built exploration data models: single flat tables at the lowest domain grain with fully additive metrics and overlapping coverage across products, orders and customers. Merchants use it through ShopifyQL Notebooks, partners through GraphQL APIs, and Shopify plans to power all Admin analytics with it, with pivoting, aggregate filters in WHERE and more chart types on the roadmap.
- ShopifyQL Notebooks: Simplifying Querying with Commerce Data Models
Shopify Engineering mediumAdeptShopify built commerce data models behind ShopifyQL Notebooks so merchants can query metrics like sales and view-to-purchase conversion without SQL or joining across departmental datasets. Good models are purpose-driven, explorable (right granularity, useful dimensions, fully additive metrics rather than semi- or non-additive ones) and extensible. The process runs from business questions to mock data and template queries, then to sourcing upstream tables, checking quality and consistency, and deriving freshness from upstream SLOs. Build time improved by switching from full-drop to incremental pipelines, at some cost in maintainability, and query speed improved with daily per-product roll-up tables for high-cardinality GROUP BYs.
- Building a Real-time Buyer Signal Data Pipeline for Shopify Inbox
Shopify Engineering mediumAdeptShopify 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.
- From batch processing to streaming: AMP’s data journey from open-source to ClickHouse Cloud
ClickHouse mediumAdept
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. Shopify webhooks flow through Amazon EventBridge and Lambda into ReplacingMergeTree tables, which deduplicate updates. To avoid the cost of small inserts, Kinesis Data Firehose buffers events to S3 and asynchronous inserts are enabled, since ClickHouse performs best with batches of at least 1,000 rows. Environments are provisioned reproducibly with the ClickHouse Cloud Terraform provider.
- Shopify powers observability for global-scale commerce with ClickHouse
ClickHouse mediumAdept
Shopify consolidated metrics, logs, traces, exceptions and profiles from multiple vendors onto Observe, an internal observability platform built on self-hosted ClickHouse, and saw a 16x query improvement out of the box (over 30x at peak) along with predictable costs. The platform ingests about 100M events/s (~110 GB/s) at BFCM peak and keeps data queryable within a minute. Key techniques: Kafka buffering with large synchronous acknowledged inserts for durability, materialized views for field metadata (50-100 ms autocomplete) and request-ID correlation (10x faster lookups), promoting hot Map keys to typed columns (~30% faster), sorting map keys at write time (20-40% disk savings), and a custom Kubernetes operator for declarative schema migrations across ~20 tenants. Next steps include tiered NVMe/SSD/object storage, native JSON types and a Rust ingestion rewrite, and the team says it would likely choose ClickHouse Cloud if starting today.