Self-Service Data Quality Incident Workflow
This design outlines a fully engineered, self-service workflow for detecting, triaging, and remediating data quality (DQ) incidents. It leverages a modern data stack (e.g., Snowflake/BigQuery for storage, dbt/Airflow for orchestration, Great Expectations/Monte Carlo for DQ checks, PagerDuty/Slack for notifications, and Retool for a self-service portal). The system is self-service by empowering data owners/stewards to configure triggers, own incidents, and track SLAs without central IT involvement.
Key principles:
Automation-first : 90% of incidents auto-detected and triaged.
Self-service : Owners define rules, claim incidents, and remediate via portal.
Scalable : Handles 1000s of datasets; cloud-native (e.g., AWS/GCP serverless).
Observable : Dashboards for SLA compliance and trends.
1. Architecture Overview
code Copy code
[Data Sources/Pipelines] --> [DQ Monitoring Layer] --> [Incident Engine]
|
v
[Self-Service Portal] <--> [Notification/Alerting] <--> [Remediation Workflow]
|
v
[Resolution & Reporting] --> [BI Dashboards (e.g., Looker/Tableau)]
Core Components :
Component Tech Purpose DQ Checks Great Expectations + dbt tests + custom SQL/ML Run checks on freshness, completeness, validity, uniqueness, accuracy. Orchestration Apache Airflow/Prefect Schedules checks (e.g., hourly/daily post-ETL). Incident Engine Custom Python service (FastAPI) + PostgreSQL Detects issues, auto-triages, creates tickets. Self-Service Portal Retool/Streamlit UI for config, incident mgmt, remediation templates. Notifications Slack + PagerDuty + Email Alerts with links to portal. Escalation PagerDuty workflows Auto-escalate on SLA breach. Reporting Metabase/Looker SLA dashboards, incident trends.
Deployment: Kubernetes (EKS/GKE) with Terraform IaC. Cost: ~$500/mo for 100 datasets.
2. Detection Triggers
Triggers fire on proactive checks (scheduled) or reactive events (e.g., pipeline failures). Owners configure via portal (YAML/UI).
Trigger Types
Rule-Based (Deterministic) :
Completeness: null_pct > threshold (e.g., 5%).
Freshness: hours_since_update > SLA (e.g., 24h for daily tables).
Validity: invalid_email_pct > 1% or schema drift.
Uniqueness: dupe_pct > 0.1%.
Accuracy: Business rules, e.g., sales_amount >= 0.
Statistical/Anomaly Detection :
ML models (e.g., Prophet/Isolation Forest via Monte Carlo or custom Prophet in Airflow).
Triggers: metric deviates >3σ from historical baseline (e.g., row count drops 20%).
Event-Driven :
Pipeline failures (Airflow sensor).
Downstream impact: Queries spike on bad data (query logs).
Configuration Example (YAML in Portal) :
yaml Copy code
dataset: prod.sales
owner_team: revenue
triggers:
- type: freshness
threshold: 24h
severity_weight: 2
- type: anomaly
metric: row_count
model: prophet
threshold: 3sigma
Frequency : Hourly for critical datasets, daily for others. ~5-10min runtime per check.
3. Auto-Triaged Severity
On trigger, the Incident Engine computes severity in <1min using a scoring formula :
code Copy code
impact_score = (%_rows_affected * dataset_tier) * downstream_users
urgency_score = duration_hours / freshness_sla
raw_severity = impact_score * urgency_score * trigger_weight
Severity Mapping:
- Critical: raw >= 80 (e.g., 50% rows bad in Tier-1 dataset, persisting 12h)
- High: 40-79
- Medium: 10-39
- Low: <10
Dataset Tiering (owner-configurable):
Tier Criteria Example Multiplier 1 (Critical) Core revenue/ML models sales, customer_360 10x 2 (High) Operational reports inventory 5x 3 (Medium) Analytics marketing_logs 2x 4 (Low) Archives raw_logs 1x
Auto-Triage Logic (Python pseudocode):
python Copy code
def triage(trigger_data):
impact = (trigger_data.rows_affected_pct * dataset_tier_multiplier) * user_count
urgency = trigger_data.duration_hours / dataset_freshness_sla_hours
score = impact * urgency * trigger.severity_weight
return map_score_to_severity(score)
Incident record includes: Dataset, Issue desc, Affected volume, Evidence (SQL snippet/chart), Portal link.
4. Self-Service Workflow
End-to-end automation with human-in-loop for remediation.
code Copy code
Detect --> Create Incident --> Notify Owner --> [Portal: Claim/Ack] --> Investigate
| |
v v
Auto-Close (flaky) Remediate --> Verify --> Close
| |
v v
Escalate on SLA Breach Post-Mortem (optional)
Steps :
Incident Creation : Auto-generates ticket in portal DB with triage details.
Notification :
Slack channel: @data-owner-team #incident-{id} [CRITICAL] sales table 30% nulls → [link]
PagerDuty for Critical/High.
Self-Service Actions (Portal)**:
Claim : Owner clicks "Assign to Me".
Acknowledge : Button hit → Starts SLA clock.
Investigate : Run ad-hoc queries, view charts.
Remediate : Templates (e.g., "Re-run ETL", "Quarantine data") with one-click Airflow DAG triggers.
Verify : Re-run DQ check → Auto-close if passed.
Escalate/Unclaim : If needed.
Auto-Close : Retries check 3x; closes if resolved (e.g., transient schema issue).
Post-Mortem : Medium+ incidents prompt root-cause form (e.g., "Pipeline bug?").
Portal UI Mock :
Dashboard: My Incidents, SLA compliance heatmap.
Incident Detail: Timeline, chat (Slack integration), remediation buttons.
5. Remediation SLAs
SLA clock starts on notification. Tracked in portal; breaches auto-escalate (PagerDuty → manager).
Severity Ack Time First Response Resolve Time Escalation Critical 15 min 30 min 4 hours +Eng Manager High 1 hour 2 hours 1 business day +Data Lead Medium 4 hours 8 hours 3 business days +Team Lead Low 1 day N/A 7 business days None
Resolve Definition : DQ check passes + verification run.
Compliance Target : 95% on-time.
Penalties : Dashboard flags; auto-reports to leadership.
6. Implementation Roadmap
Phase Tasks Timeline Owner 1: MVP Airflow + Great Expectations + Slack alerts + Basic triage 2 weeks Data Eng 2: Portal Retool portal + YAML config + Auto-triage +2 weeks Data Eng + Analysts 3: Advanced ML anomalies + Templates + Escalations +3 weeks Data Eng 4: Scale Dashboards + Post-mortems +1 week Analysts
Total Cost to Build : 8 engineer-weeks (~50 k ) . ∗ ∗ O n g o i n g ∗ ∗ : 50k). **Ongoing**: 50 k ) . ∗ ∗ O n g o in g ∗ ∗ : 500/mo.
7. Success Metrics & Monitoring
Detection Coverage : 100% of production datasets.
MTTD (Mean Time to Detect) : <1 hour.
MTTR (Mean Time to Resolve) : <SLA avg.
False Positive Rate : <5% (tunable thresholds).
Dashboards : Incidents by severity/dataset, SLA burn-down, top issues.
This workflow reduces central team toil by 80% while ensuring DQ SLAs. Customize tiers/SLAs per org. For code/repo starters, reply with specifics!