Intermediate

Designing Good Data Architecture

9 Principles of good data architecture and modern architectural patterns

⏱️ 40 min read 📅 Updated Jan 2025 👤 Based on "Fundamentals of Data Engineering" by Joe Reis & Matt Housley

🎯 Learning Objectives

Mode Baca Pemula

Topik arsitektur bisa terasa abstrak. Fokus dulu ke:

  1. Definisi data architecture
  2. Prinsip arsitektur yang paling relevan
  3. Pattern dasar sebelum masuk data mesh

Kamus istilah: DE-GLOSSARY.md

Prasyarat Ringan

Istilah Penting (3 Lapis)

Istilah: Data Architecture

Definisi awam: Cetak biru cara sistem data dibangun.

Definisi teknis: Desain struktur komponen, alur data, serta prinsip reliability, scalability, dan governance.

Contoh praktis: Menentukan bagaimana data dari OLTP masuk lakehouse lalu disajikan ke BI/API.

Istilah: Data Mesh

Definisi awam: Data dikelola per domain bisnis, bukan satu tim pusat saja.

Definisi teknis: Arsitektur domain-oriented dengan data-as-a-product dan federated governance.

Contoh praktis: Tim Finance dan Growth punya data product dengan owner dan SLA masing-masing.

Apa itu Data Architecture?

Data Architecture adalah blueprint dari sistem data kamu. Ini menjawab pertanyaan: Bagaimana data bergerak dari sumber ke konsumen? Bagaimana komponen-komponen saling berhubungan? Bagaimana sistem akan scale dan evolve seiring waktu?

⚠️ Architecture vs Implementation

Architecture adalah "what" dan "why", sedangkan implementation adalah "how". Architecture harus stabil dan timeless, sementara technologies berubah terus.

The 9 Principles of Good Data Architecture

Berikut adalah 9 principles yang ditetapkan oleh Joe Reis & Matt Housley dalam buknya:

1

Choose Common Components Wisely

Pilih komponen yang bisa digunakan bersama (shared services) tapi jangan terlalu banyak. Contoh: Gunakan satu data warehouse untuk semua tim, tapi jangan paksakan semua tim pakai tools yang sama untuk analysis.

2

Plan for Failure

Design sistem yang resilient. Komponen akan fail, network akan down, data akan corrupt. Pertanyaannya bukan "if" tapi "when". Implement redundancy, backup, dan disaster recovery.

3

Architect for Scalability

Plan untuk growth. Apa yang works untuk 1GB data mungkin tidak works untuk 1PB. Pertimbangkan horizontal vs vertical scaling, partitioning, dan distributed systems.

4

Architecture Is Leadership

Data Architect bukan hanya technical role tapi juga leadership. Kamu perlu:

5

Always Be Architecting

Architecture adalah continuous process, bukan one-time activity. Requirements berubah, technologies evolve, dan architecture harus adapt.

6

Build Loosely Coupled Systems

Komponen harus independent. Jika satu service down, services lain tetap berjalan. Gunakan APIs, message queues, dan event-driven architecture untuk decoupling.

7

Make Reversible Decisions

Avoid irreversible decisions. Pilih technologies dan patterns yang bisa diubah jika kebutuhan berubah. Abstract away vendor-specific features untuk avoid vendor lock-in.

8

Prioritize Security

Security bukan afterthought. Design dengan security mindset dari awal:

9

Embrace FinOps

Cost adalah first-class citizen dalam architecture. Cloud costs bisa spiral out of control. Monitor costs, set budgets, dan optimize resource allocation.

Architectural Patterns

Monolith vs Microservices

Aspect Monolith Microservices
Complexity Lower (single codebase) Higher (distributed systems)
Deployment All-or-nothing Independent deployments
Scalability Scale everything together Scale individual services
Team Structure Small teams Multiple autonomous teams
Best For Startups, small teams, simple domains Large orgs, complex domains, scale needs

💡 The Distributed Monolith Trap

Banyak yang "migrate to microservices" tapi end up dengan distributed monolith - services yang tightly coupled sehingga harus deploy bareng. Ini worst of both worlds: complexity of microservices tanpa benefitsnya.

Lambda Architecture

Lambda Architecture adalah pattern untuk handling both batch and real-time data:

Lambda Architecture Layers

🔄 Batch Layer (Slow)
Process all historical data. High latency (hours), high accuracy.
⚡ Speed Layer (Fast)
Process real-time data. Low latency (seconds), approximate results.
📊 Serving Layer
Merge batch + speed views untuk complete picture.

🛒 Contoh: E-commerce Analytics

Kappa Architecture

Kappa Architecture adalah simplified version: streaming only. Semua data dianggap stream, termasuk "batch" yang sebenarnya adalah bounded streams.

✅ When to Use Kappa over Lambda

Data Mesh

Data Mesh adalah architectural paradigm yang berpikir data sebagai product dan mendistribusikan ownership ke domain teams.

The 4 Principles of Data Mesh

1️⃣ Domain Ownership

Domain teams own their data end-to-end

2️⃣ Data as a Product

Treat data with same rigor as software products

3️⃣ Self-Serve Platform

Platform team provides infrastructure, domains build

4️⃣ Federated Governance

Global standards with local autonomy

🏦 Contoh: Bank dengan Data Mesh

Sebuah bank memiliki beberapa domain:

Setiap domain punya data product owner yang bertanggung jawab untuk: data quality, documentation, dan serving data ke consumers lain.

Case Study: Architecture Evolution

📈 Evolution of Gojek's Data Architecture

Phase 1: Monolith (2015-2017)

Phase 2: Lambda Architecture (2017-2019)

Phase 3: Stream-First / Kappa (2019-2021)

Phase 4: Data Mesh (2021-present)

Decision Framework: Architecture Choices

Decision Point Pilih Opsi A Jika... Pilih Opsi B Jika...
Monolith vs Modular Tim kecil, scope produk masih awal Domain kompleks, ownership tim terpisah
Central platform vs Domain-owned Governance ingin ketat dan standar seragam Butuh otonomi domain dan time-to-market cepat
Build vs Buy Kebutuhan sangat spesifik dan strategic moat Use case umum tersedia mature managed solution

Failure Modes & Anti-Patterns

Anti-Patterns Arsitektur

Production Readiness Checklist

Checklist Architecture Review

  1. Dependency map antar komponen terdokumentasi.
  2. Failure scenario utama sudah diuji (tabletop/chaos ringan).
  3. SLO per komponen dan data product jelas.
  4. Observability baseline aktif (logs, metrics, lineage).
  5. Biaya operasional dipantau per domain.
  6. Security controls masuk dari fase desain.

✏️ Exercise: Design an Architecture

Kamu adalah Data Architect di Tokopedia. Design architecture untuk sistem berikut:

Requirements:

Pertanyaan:

  1. Lambda atau Kappa architecture? Kenapa?
  2. Monolith atau Microservices? Trade-offs apa?
  3. Apa 3 principles yang paling penting untuk use case ini?
  4. Apakah Data Mesh cocok untuk organisasi ini? Kenapa?

🎯 Quick Quiz

1. Principle mana yang menekankan importance of cost management?

A. Plan for Failure
B. Embrace FinOps
C. Always Be Architecting
D. Build Loosely Coupled Systems

2. Dalam Lambda Architecture, layer mana yang menangani real-time data?

A. Batch Layer
B. Speed Layer
C. Serving Layer
D. Storage Layer

3. Apa keuntungan utama Kappa vs Lambda?

A. Lebih cepat dalam processing
B. Hanya satu code path untuk maintain
C. Lebih murah dalam storage
D. Lebih mudah untuk debugging

Key Takeaways

🎯 Summary

📚 References & Resources

Primary Sources

Articles & Websites