Case study

Rota do Perfume

A Databricks lakehouse that turns 10 ERP and CRM CSV files into a weekly queue of 200 sales calls, right on the director's screen.

Fictional distributor. The data was generated for this study, in the shape it takes at real companies.

This week's queue
200contacts recommended by the model, for 36 sales reps
Actual conversion
41.7%5 orders from the 12 calls made so far
Lift over random
4.1x10.1% was the rate when calling at random
Expected revenue
R$ 559Kpurchase probability times average order value

The data every company has

The starting point was 10 ERP and CRM CSV files with over 300,000 rows. Dates in two formats in the same column. Company tax IDs (CNPJ) with stray spaces. Duplicates. The kind of mess that breaks reports and, worse, breaks decisions.

The answer was a layered pipeline (raw, bronze, silver, gold), defined entirely as code with Databricks Asset Bundles. Schemas, jobs, the dashboard and the Genie spaces are versioned and ship in the same deployment.

Three decisions I stand by

Cleaning must not change the business

The R$ 102 million in revenue reconciles exactly from bronze to gold. Data quality tests fail the pipeline when anything diverges. The rule is to fix the transformation, never the test.

Metadata is a contract

Every column an AI queries has an audited business comment. A job task fails if one is missing. That is what makes Genie answer "how much is the queue worth?" with the right number and the word "estimate".

Data becomes action

A purchase propensity model (scikit-learn and MLflow, 4x lift over a random queue) feeds the weekly queue. The team logs the outcome of every contact in the React Databricks App. In the first week, actual conversion was 41.7%, against the 41.5% the model predicted.

The app the director opens on Monday

Three tabs (the app itself is in Portuguese): this week (who to call), tracking (whether the model holds up) and ask (Genie, running with the user's own Unity Catalog permissions).

Genie in the workspace, not just in the app

The same metadata contract answers outside the app, in the Databricks Genie space. A business question becomes a number you can verify.

Deployment as code, app in production

The rotaperfume-direcao app is deployed with Databricks Asset Bundles. The serverless warehouse, the Genie space and the React front end ship in the same bundle.

What's next

The project is still evolving. The next steps are extracting the transformations into Python modules that can be tested outside the notebook, and moving infrastructure provisioning to Terraform, so the same environment can be reproduced in any workspace.