Data Governance & Lineage
Seiring data semakin banyak dan kompleks, organisasi butuh governance (tata kelola) untuk memastikan data dikelola dengan benar, aman, dan sesuai regulasi.
Pilar Data Governance
- Data Catalog — Inventaris semua dataset: apa isinya, siapa pemiliknya, di mana disimpan
- Data Lineage — Tracking asal-usul data: dari mana, transformasi apa, ke mana
- Access Control — Siapa boleh akses data apa (RBAC, column-level security)
- Data Quality — Monitoring dan enforcement kualitas data
- Compliance — Kepatuhan terhadap regulasi (GDPR, PDP Law Indonesia)
Data Lineage
Melacak perjalanan data dari sumber sampai konsumsi. Penting untuk debugging, impact analysis, dan compliance.
// Data lineage graph
//
// PostgreSQL.orders ──→ raw.orders ──→ stg_orders ──→ revenue_daily ──→ Dashboard
// │
// PostgreSQL.users ──→ raw.users ──→ stg_users ──┘
// │
// └──→ user_segments ──→ Marketing Tool
//
// Pertanyaan yang dijawab lineage:
// 1. "Revenue dashboard salah — data dari mana?" → Trace upstream
// 2. "Mau ubah kolom orders.amount — siapa terdampak?" → Trace downstream
// 3. "Data PII user ada di mana saja?" → Full lineage scan
// dbt otomatis generate lineage dari ref()
// Tools: Apache Atlas, DataHub, Atlan, dbt lineage
Data Catalog
# Metadata catalog entry (contoh format)
dataset:
name: mart.revenue_daily
description: "Daily revenue aggregated by country and plan"
owner: data-engineering-team
pii: false
freshness: "Updated daily at 06:00 WIB"
schema:
- name: date
type: DATE
description: "Transaction date"
- name: country
type: STRING
description: "User country from dim_user"
- name: total_revenue
type: DECIMAL
description: "Sum of order amounts in IDR"
lineage:
upstream: [stg_orders, stg_users]
downstream: [executive_dashboard, finance_report]
tags: [revenue, finance, daily]
# Tools populer:
# - DataHub (LinkedIn, open-source)
# - Apache Atlas (Hadoop ecosystem)
# - Atlan (modern, cloud-native)
# - dbt docs (built-in untuk dbt projects)
Compliance & PII
// PII (Personally Identifiable Information) handling
// Regulasi: GDPR (EU), UU PDP (Indonesia)
// 1. Identifikasi PII
pii_columns = ["name", "email", "phone", "ip_address", "ktp_number"]
// 2. Masking/Hashing
// Raw: "[email protected]" → Warehouse: "b***@e****.com"
// Atau hash: SHA256("[email protected]") → "a1b2c3..."
// 3. Column-level access control (BigQuery)
// Analyst bisa query revenue tapi tidak bisa lihat email
// 4. Data retention
// Hapus data personal setelah X tahun
// Right to be forgotten: delete by user_id
// 5. Audit log
// Track siapa query data apa, kapan