Data, MLOps & Model Lifecycle
Data Architecture & Governance
Lakehouse กับ medallion architecture, 4 principles ของ data mesh, data quality, lineage และ data catalog ด้วย Microsoft Purview, PII classification และ masking และ data residency สำหรับระบบ AI
AI ดีได้เท่า data ที่ป้อนให้ ถ้า documents ใน RAG index ล้าสมัย หรือ training data มี customer data ที่ไม่ควรใช้ ปัญหาจะไม่ปรากฏตอน demo แต่จะปรากฏตอน audit บทนี้ว่าด้วยการวาง data platform และ governance ที่ทำให้ใช้ data กับ AI ได้อย่าง มั่นใจและ auditable
Lakehouse & the medallion architecture
Data warehouse เก่งเรื่อง structured data และ reporting data lake เก็บได้ทุกแบบในราคาถูกแต่มักกลายเป็น “data swamp” lakehouse รวมสองอย่างเข้าด้วยกัน เก็บไฟล์ใน low-cost storage ด้วย open table format (เช่น Delta Lake หรือ Apache Iceberg) ที่รองรับ ACID transactions และ schema
Layering ที่นิยมเรียกว่า medallion architecture
| Layer | เนื้อหา | ใครใช้ |
|---|---|---|
| Bronze | raw data ตามที่ ingest มา เก็บไว้เพื่อ audit และ reprocess | data engineers |
| Silver | cleaned, deduplicated, conformed, รวมจากหลาย sources | analysts, data scientists |
| Gold | curated data ตาม use case เช่น monthly aggregates, ML features, documents ที่คัดแล้วสำหรับ RAG | BI, ML, RAG index |
บน Azure ณ ปี 2026 ใช้ได้ทั้ง Microsoft Fabric (OneLake), Azure Databricks หรือ Data Lake Storage Gen2 ร่วมกับ processing engine
Data mesh: when the central data team becomes a bottleneck
ในองค์กรใหญ่ central data team ทีมเดียวไม่สามารถเข้าใจทุก domain ได้ data mesh เสนอ 4 principles
- Domain ownership domain teams (เช่น บัตรเครดิต สินเชื่อ) เป็น owner ของ data ของตนเอง
- Data as a product data ที่ share ให้ทีมอื่นต้องมี owner, documentation, agreed quality และ SLA เหมือน product
- Self-serve data platform central team ทำ platform ที่ทุก domain ใช้สร้าง data products ได้เอง
- Federated computational governance shared rules (security, classification, formats) กำหนดจากส่วนกลาง และ enforce อัตโนมัติด้วย platform
Data mesh เป็นเรื่องของ organization design มากกว่า technology และไม่เหมาะกับองค์กรที่ยังมี data team ไม่กี่คน
Data quality, lineage & catalog
- Data quality automated checks ในทุก layer เช่น completeness, valid ranges, freshness ถ้าไม่ผ่านให้หยุด pipeline แทนที่จะส่ง bad data ต่อ
- Lineage trace ได้ว่า data หนึ่งมาจากไหน ผ่าน transformations อะไรมาบ้าง เมื่อพบ data ผิดจะรู้ว่า impact กับ reports และ models ใด และเมื่อ auditor ถามว่าคำตอบของ AI มาจาก document ใด ก็ตอบได้
- Data catalog registry ว่ามี datasets อะไร ใครเป็น owner ความหมายของแต่ละ field และ sensitivity level
บน Azure ใช้ Microsoft Purview ทำ catalog, lineage และ automated data classification
Personal data & AI
Data classification เช่น Public, Internal, Confidential, Restricted และ label PII เช่น เลขบัตรประชาชน เลขบัญชี เบอร์โทร
Techniques ที่ใช้บ่อย
| Technique | ความหมาย | ใช้เมื่อ |
|---|---|---|
| Masking | ปิดบางส่วน เช่น xxx-x-x1234-x | แสดงผลให้คนที่ไม่จำเป็นต้องเห็นเต็ม |
| Tokenization / pseudonymization | แทนด้วย token ที่ reverse ได้เฉพาะระบบที่มีสิทธิ์ | ส่ง data ไป analyze โดยยัง link กลับได้ |
| Anonymization | ตัดจน identify บุคคลไม่ได้อีก | data สำหรับ training หรือ testing ที่ไม่ต้อง reverse |
| Data minimization | ไม่ส่ง data ที่ไม่จำเป็นเลย | ทุกครั้ง โดยเฉพาะก่อนใส่ใน prompt |
Data residency
Data residency คือ requirement ว่า data ต้องเก็บหรือ process ในประเทศหรือ region ใด มีผลโดยตรงต่อ AI architecture
- เลือก region ของ storage, index และ model ให้ตรง requirement
- ตรวจว่า LLM service process data ที่ไหน Azure OpenAI มี deployment types หลายแบบ เช่น Global (data at rest อยู่ใน geography ที่เลือก แต่ inference อาจเกิดใน region อื่นทั่วโลก), Data Zone (process ภายใน zone ซึ่ง ณ ปัจจุบันมีเฉพาะ US และ EU) และ Regional (process ใน region ที่ deploy) สำหรับ requirement ที่เข้มงวด ให้ตรวจว่า allowed region มี model ที่ต้องการหรือไม่ แล้วเลือก regional deployment
- Enforce ด้วย Azure Policy ไม่ให้สร้าง resources นอก allowed regions
Requirement จริงขึ้นกับกฎหมาย, contracts และ policy ของแต่ละองค์กร ต้องตกลงกับทีม compliance และ legal ตั้งแต่ช่วง design (บทที่ 10 (Security, Governance & Compliance))