Incremental product events, run at useful times and shut down pipelines of accounts that have left.
Not everything needs to be real time. Pulling each source at the pace the business requires saves credits and avoids noise.
Each company organizes the layers as it makes sense. What matters is the concept: raw, refined, ready.
| account | plan | mrr | status |
|---|---|---|---|
| Acme | Growth | R$490 | active |
Counting canceled trials as churn inflates the number and scares the board for nothing. The rule lives in the semantic layer, only once, and everyone reads it.
| Column | Description |
|---|---|
status int | 1 = active, 2 = cancelled, 3 = overdue |
mrr decimal | Monthly recurring revenue, in BRL |
plano text | Starter, Growth or Custom |
Don't create a star schema when a wide table resolves. A beautiful model in the diagram is often expensive in practice.
Train a churn model, assemble the retention matrix in pandas, enrich via API and process ticket text. Rule: SQL for most, notebook when you need logic or libs.
| month_id → dim_tempo |
account_id → dim_conta |
plan_id → dim_plano |
mrr |
|---|---|---|---|
| t_06 | c_5521 | pl_2 | R$490 |
| t_06 | c_7702 | pl_1 | R$ 190 |
| month | account | plan | mrr | status |
|---|---|---|---|---|
| 06 | Acme | Growth | R$490 | active |
| 06 | Bobserv | Starter | R$ 190 | delay |
| 06 | Custor | Custom | R$ 2.4k | active |
{
"month": "2026-06",
"mrr": 152000,
"churn_mrr": 6800
}Reliable Gold Tier plus registered settings. The agent responds with the house ruler.
A token limited to revenue tables feeds the execs dashboard without exposing sensitive product data.
| cohort | M0 | M1 | M2 | M3 | M4 | M5 | M6 |
|---|---|---|---|---|---|---|---|
| 2025-08 | 100 | 92 | 88 | 85 | 83 | 81 | 79 |
| 2025-09 | 100 | 90 | 87 | 84 | 82 | 80 | · |
| 2025-10 | 100 | 94 | 91 | 88 | 86 | · | · |
| 2025-11 | 100 | 88 | 83 | 79 | · | · | · |
| 2025-12 | 100 | 91 | 86 | · | · | · | · |
| 2026-01 | 100 | 89 | · | · | · | · | · |
Only subscriptions that have paid at least once are included. A canceled trial is not churn.
| account | mrr | signs | risk |
|---|---|---|---|
| Bobserv | R$490 | usage -60%, delay | High |
| Dext | R$ 190 | open ticket | Medium |
| Acme | R$ 2.4k | stable use | Bass |
Seeing the risk early is the difference between a hold call and a cancellation.