Case study 01
Replacing a CDP with a warehouse, a segmentation layer and an MCP server.
Café Zupas, 90+ locations / 2024 to present
$240K per year in license fees, gone.
The problem
The brand was paying a third-party customer data platform a quarter of a million dollars a year to do three things: stitch identity, build segments and hand audiences to Braze. The CDP owned the logic, the data was a black box to the analysts, and every new segment was a ticket to the vendor.
What I built
- 01
Warehouse
Hourly BigQuery marts built from POS, loyalty (SessionM), app, web and Braze event streams. Identity keyed on mapped IDs rather than email strings. Version-controlled metric definitions in Git so 'active customer' means one thing everywhere.
- 02
Segmentation layer
A SQL-defined segment catalog that compiles to audiences and syncs to Braze on a schedule. Real-time triggers for the behaviors that matter (first order, lapsed, in-store scan). Email, SMS, push and in-app all read from the same segment definitions.
- 03
MCP on top
A Model Context Protocol server exposing the marts to Claude under least-privilege IAM. Every employee with an AI seat can ask questions in plain English and see the SQL that answered them. The daily query-log audit found no raw-dataset policy violations in the first months after rollout.
- 04
Evaluation and quality
A versioned evaluation set (49 cases: 29 rule, 6 ambiguity, 14 SQL) graded against cited rulings and reference SQL on a pinned window. Cases are retired, never edited, when a ruling changes, so expected answers never leak into the corpus. A backtest against a known-bad commit failed 4 of 6 affected cases, which is the proof it catches regressions. Behind it: a daily automated review of every query run against the warehouse (hundreds a day), a weekly drift detector for silent source-structure changes, and a deploy gate that blocks any view change whose live definition has drifted from the committed SQL.
Outcomes
- $240K per year in CDP license fees eliminated. Pipelines now run on GCP at a fraction of that.
- Identified-customer revenue up 17.7% year to date against 3.4% company growth, eight straight months of double-digit gains.
- Identified share of sales up from 37% to 42%. Active customers (purchased in the trailing twelve months) up 14.6% to 550K, repeat orders up 19.4% on flat acquisition.
- In-store loyalty scan program up 27% in orders. Mobile app adoption up 20%.
- Governed data access went from a handful of SQL analysts to ten AI seats across the business.
- No raw-dataset policy violations observed since the governance rollout.
Found along the way
- Found and killed a silent race condition that had erased ten business days from a core fact table.
- Corrected an eight-year-old employee-benefit classification error, surfacing roughly $750K in previously unflagged spend.
Stack
- BigQuery
- Cloud Run
- Cloud Scheduler
- IAM
- Git
- Braze
- SessionM
- Claude
- MCP
- Python
- SQL
- GA4 export
- server-side GTM