Chuỗi: lakehouse-layer-spec · Phần 3
Năng suất & công cụ dev
Lakehouse Layer 3 — Curated Layer
Curated Layer: đã làm sạch, chuẩn hóa, logic nghiệp vụ. Nguồn chính cho báo cáo, phân tích rủi ro, AI/ML, API. Join, enrich, quản trị schema.
2026-03-171 phút đọcVI
Spec – Layer 3: Curated Layer
1. Mục đích
Curated Layer là lớp dữ liệu đã làm sạch, chuẩn hóa và biến đổi theo logic nghiệp vụ. Nguồn chính cho: báo cáo vận hành & tài chính; phân tích rủi ro & hiệu suất; đầu vào AI/ML; API cho hệ thống/đối tác downstream.
2. Cấu trúc lưu trữ
Parquet hoặc Iceberg table; partitioning theo business_date, store_id, customer_segment; thư mục minio://lakehouse/curated/<domain>/<table>/; tên bảng cur.<domain>.<table> (vd. cur.crm.customer_profile). Iceberg/Delta: schema evolution, time travel.
3. Logic xử lý & enrich (staging → curated)
Join nhiều bảng domain (customer, contract, payment, risk_score); áp dụng logic phân loại, chỉ số: customer_segment, ltv, churn_score; record mang giá trị đã tính — không ghi đè. Ví dụ enrich: start_date → days_since_loan; payment amount/count → customer_ltv_3m; risk_score → risk_level; dob → age_group.
4. Chuẩn schema & quản trị
Cột có description; phân loại dimension/measure/computed; UUID thay số tự tăng; mỗi bảng có owner, steward (DataHub).
5. Kiểm thử DQ
unique_key (customer_id, contract_code); value range (loan_amount > 0, ltv 0–2.5); business logic (closed_date > start_date, active → contract_status open); missing join rate < 1%.
6. Bảo mật & phân quyền
Data Analysts, BI, ML được truy cập curated; RBAC theo domain (CRM, Risk); masking PII (phone, email, id_number) khi chia sẻ.
7. Ứng dụng
CLTV → cur.crm.customer_profile; báo cáo nợ quá hạn → cur.lending.contract_risk; API đối tác → cur.payment.partner_extract. Metadata: tag layer:curated, confidentiality, analytics-ready; schema version Iceberg + Git (dbt snapshot).
