Skip to content
Matías Hidalgo
← All work

A wholesale distributor

A sales warehouse you can ask questions in plain language

Several databases and APIs unified into one tested warehouse, with a semantic layer and an MCP server so management can ask the data questions in plain language.

The problem

A wholesale distributor kept its sales information in several places that did not talk to each other: four MySQL databases, a legacy Firebird system and a handful of internal APIs. Answering a simple question such as "how are we doing with this brand?" meant someone exporting files and stitching them together. Management and the sales team could not trust one version of the numbers, and nobody could just ask.

What I built

I designed a sales data warehouse on PostgreSQL. Dagster orchestrates the loading, with partitions and sensors so only the data that changed is reprocessed. dbt builds incremental models and runs tests on them, and when something fails, the team is alerted on Slack.

On top of it I built a semantic layer (Cube), where each metric is defined once, and an MCP server, so management could connect Claude and ask the sales data questions in plain language.

How it works

Build the warehouse

  1. Four MySQL databases
    Firebird (legacy ERP)
    Internal APIs
  2. Dagster: partitions and sensors
  3. dbt: incremental models and tests
  4. PostgreSQL warehouse

Failures alert the team on Slack

Ask a question

  1. PostgreSQL warehouse
  2. Cube: governed metrics
  3. MCP server
  4. ClaudeManagement connects it and asks in plain language
Simplified diagram. No real data.

The first lane is the plumbing: sources are loaded on schedule or when a sensor sees new data, modelled and tested in dbt, and land in one warehouse. The second lane is the question: the warehouse is exposed through the Cube semantic layer and the MCP server. Management connects Claude to it and asks in their own words, and the figures come from the governed metrics rather than from a model's memory.

The result

The distributor has one tested source of truth instead of many exports, and problems show up in a Slack alert before they show up in a report. Because metrics are defined once and served over MCP, management can ask the data questions in plain language and get answers based on the same numbers everyone else sees.

Stack

  • Dagster
  • dbt
  • PostgreSQL
  • MySQL
  • Firebird
  • Cube
  • MCP
  • TypeScript
  • Slack alerts

Need something like this?

I can take it from the first conversation to production.

Next case

The field sales team's planning app →