Data Mesh Design for Finance Metrics
This design applies data mesh principles to finance metrics: domain-oriented ownership, data as a product, self-serve infrastructure, and federated governance. Finance is decomposed into autonomous domains that own their data products (analytical datasets, metrics, and models). Each domain exposes data via standardized contracts (interfaces like APIs, schemas, and documentation). Quality SLAs ensure reliability, enforced via automated monitoring (e.g., Great Expectations, Monte Carlo) and a central data catalog (e.g., DataHub or Collibra).
Key Assumptions
- Tech Stack: Domains use domain-specific tools (e.g., dbt for modeling, Kafka for streaming, REST/GraphQL for APIs). Self-serve infra via platforms like Snowflake, Databricks, or BigQuery.
- Global Standards (Federated Governance):
- Contracts: OpenAPI 3.0 for APIs, Avro/Protobuf schemas for streams, dbt docs for tables.
- Metrics: Standardized via a global ontology (e.g., revenue as
{date, amount_usd, currency, segment}).
- Quality Dimensions: Freshness, Completeness, Accuracy, Timeliness, Validity (measured via SLAs).
- Catalog: All products discoverable in a central portal with lineage and SLAs.
- Consumers: Analysts, dashboards (e.g., Tableau), ML models consume via self-serve portals.
Domains and Data Products
Five core domains cover 80% of finance metrics. Each owns source-to-product pipelines, with ~5-10 key data products per domain.
1. Revenue Domain
Ownership: Revenue ops team. Sources: CRM (Salesforce), billing (Stripe/NetSuite).
Data Products:
- Daily Revenue Snapshot (table: revenue_daily).
- Revenue by Segment (API:
/revenue/segments).
- Churn Metrics Stream (Kafka topic: revenue.churn_events).
Contracts:
| Product | Interface | Schema Example |
|---|
| revenue_daily | BigQuery table / REST API | {date: date, total_usd: decimal, product_id: uuid, customer_segment: string, confidence_score: float} |
| revenue/segments | GraphQL query | query { segments(filter: {date_from: "2023-01"}) { amount, growth_rate } } |
| revenue.churn_events | Kafka (Avro) | {customer_id: uuid, churn_date: timestamp, mrr_lost: decimal} |
Quality SLAs (SLA Breach → Alert + Auto-Rollback):
| Dimension | Target | Measurement |
|---|
| Freshness | <1 hour lag | Last updated timestamp |
| Completeness | >99.5% | Rows vs. source records |
| Accuracy | >99.9% | Reconciled to GL |
| Availability | 99.99% | Uptime SLA |
| Validity | 100% | Schema conformance |
2. Expense Domain
Ownership: Procure-to-pay team. Sources: ERP (SAP/Oracle), vendor invoices.
Data Products:
- Expense Ledger (table: expenses_ledger).
- Category Spend Trends (API:
/expenses/categories).
- Vendor Payment Events (Kafka: expenses.payments).
Contracts:
| Product | Interface | Schema Example |
|---|
| expenses_ledger | Snowflake table / REST | {date: date, amount_usd: decimal, category: enum['COGS','OpEx'], vendor_id: uuid, approval_status: enum} |
| expenses/categories | REST (OpenAPI) | GET /categories?period=monthly → {category: string, spend: decimal, variance: float} |
| expenses.payments | Kafka (Protobuf) | {vendor_id: uuid, payment_date: timestamp, amount: decimal, status: enum['paid','pending']} |
Quality SLAs:
| Dimension | Target | Measurement |
|---|
| Freshness | <30 min lag | ETL job success |
| Completeness | >99% | Invoice coverage |
| Accuracy | >99.8% | Matched to bank feeds |
| Availability | 99.99% | Uptime |
| Validity | 100% | GL code validation |
3. Profit & Loss (P&L) Domain
Ownership: FP&A team. Sources: Aggregates from Revenue/Expense + GL.
Data Products:
- P&L Statement (table: pnl_monthly).
- Margin Analytics (API:
/pnl/margins).
- Variance Reports (file: pnl_variances.parquet).
Contracts:
| Product | Interface | Schema Example |
|---|
| pnl_monthly | dbt model (Databricks Delta) / GraphQL | {period: date, gross_profit: decimal, ebitda: decimal, margin_pct: float, business_unit: string} |
| pnl/margins | REST | GET /margins?bu=NorthAmerica → {gross_margin: 45.2, net_margin: 12.1} |
| pnl_variances | S3 Parquet / Catalog | {actual: decimal, budget: decimal, variance_pct: float} |
Quality SLAs:
| Dimension | Target | Measurement |
|---|
| Freshness | <2 hours EOD | Post-revenue/expense sync |
| Completeness | >99.9% | Cross-domain reconciliation |
| Accuracy | >99.95% | Audited samples |
| Availability | 99.9% | Compute resources |
| Validity | 100% | Business rule checks (e.g., margins >0) |
4. Cash Flow & Treasury Domain
Ownership: Treasury team. Sources: Bank APIs, AR/AP systems.
Data Products:
- Cash Position (table: cash_daily).
- Forecast Stream (API:
/cash/forecast).
- AR/AP Aging (Kafka: treasury.aging).
Contracts:
| Product | Interface | Schema Example |
|---|
| cash_daily | BigQuery / REST | {date: date, balance_usd: decimal, forecast_7d: decimal, liquidity_ratio: float} |
| cash/forecast | GraphQL | query { forecast(days: 30) { projected_balance } } |
| treasury.aging | Kafka | {aging_bucket: enum['0-30','30-60'], ar_amount: decimal, ap_amount: decimal} |
Quality SLAs:
| Dimension | Target | Measurement |
|---|
| Freshness | <15 min (real-time) | Bank feed polling |
| Completeness | >99.7% | AR/AP coverage |
| Accuracy | >99.99% | Bank reconciliation |
| Availability | 99.999% | Critical SLA |
| Validity | 100% | Positive balances only |
5. Budgeting & Compliance Domain
Ownership: Finance controllers. Sources: Planning tools (Anaplan), audits.
Data Products:
- Budget vs. Actuals (table: budget_actuals).
- Compliance Metrics (API:
/compliance/risk_scores).
- Audit Trail Events (Kafka: finance.audits).
Contracts:
| Product | Interface | Schema Example |
|---|
| budget_actuals | dbt / REST | {period: date, budget: decimal, actual: decimal, variance: decimal, category: string} |
| compliance/risk_scores | OpenAPI REST | GET /risk?quarter=Q1 → {sox_compliance: 98.5, risk_score: float} |
| finance.audits | Kafka | {audit_id: uuid, metric: string, change: json, timestamp: timestamp} |
Quality SLAs:
| Dimension | Target | Measurement |
|---|
| Freshness | <4 hours monthly | Budget cycle sync |
| Completeness | 100% | Mandatory fields |
| Accuracy | >99.99% | SOX-compliant audits |
| Availability | 99.95% | Regulatory priority |
| Validity | 100% | Compliance rules engine |
Implementation Roadmap
- Phase 1: Pilot Revenue + Expense domains (2-4 weeks).
- Phase 2: Build self-serve portal + monitoring (DataHub + OpenMetadata).
- Phase 3: Roll out all domains; enforce SLAs via GitHub Actions/CI-CD.
- Governance: Domain leads meet quarterly; central team owns catalog/SLAs template.
This design ensures scalable, trustworthy finance metrics with clear ownership and discoverability. Total cost: ~$50K initial (tools + training), ROI via 10x faster analytics. For customizations, provide more org details!