📊 Data Engineering

Data Mesh

Data Mesh

A distributed data architecture. Domain-oriented data ownership.

Detailed Explanation

Data Mesh is a distributed data architecture paradigm proposed by Zhamak Dehghani in 2019. It emerged to overcome the scalability limits and bottlenecks of centralized data platforms (monolithic data lakes and data warehouses). Its core philosophy is to distribute data ownership and responsibility by business domain, just as microservices distributed applications.

The four principles of Data Mesh are as follows. First, with Domain-Oriented Ownership, each business domain owns and manages its own data. Second, by treating data like a product (Data as a Product), datasets that are discoverable, quality-assured, and documented are provided from the consumer's perspective. Third, through a Self-Serve Platform, domain teams can create and deploy data products without infrastructure complexity.

Fourth, by applying Federated Computational Governance, global standards such as security, quality, and interoperability are defined centrally, while actual implementation is carried out autonomously by each domain. When these principles work in harmony, an organization can resolve data bottlenecks and innovate quickly. Similar to microservices architecture, each domain team has end-to-end responsibility, so the speed of data delivery improves.

Data Mesh is effective in large organizations (hundreds or more data-related staff), and can become excessive overhead for small organizations. Successful adoption requires changes in organizational culture, stronger data capabilities in domain teams, and a robust self-service platform. Global companies such as Netflix, Zalando, and Intuit have adopted Data Mesh to achieve data democratization and scalability.

Code Example

Data Product YAML + Self-Service Platform
# 데이터 프로덕트 정의 예시
# data-products/orders/dataproduct.yaml

apiVersion: datamesh.io/v1
kind: DataProduct
metadata:
  name: orders-data-product
  domain: order-management
  owner: order-team@company.com
  version: "2.1.0"

spec:
  description: |
    주문 도메인의 핵심 데이터 프로덕트.
    모든 주문 트랜잭션 및 집계 메트릭 제공.

  # 출력 포트 정의 (데이터 접근 방법)
  outputPorts:
    - name: orders-events
      type: streaming
      format: avro
      location: kafka://orders.events
      description: "실시간 주문 이벤트 스트림"
      sla:
        latency: "p99 < 100ms"
        availability: "99.9%"

    - name: orders-snapshot
      type: batch
      format: delta
      location: s3://data-products/orders/snapshot/
      description: "주문 스냅샷 테이블 (일별 업데이트)"
      schedule: "0 2 * * *"
      schema:
        fields:
          - name: order_id
            type: string
            description: "주문 고유 식별자"
            pii: false
          - name: customer_id
            type: string
            description: "고객 ID (암호화됨)"
            pii: true
          - name: total_amount
            type: decimal(18,2)
            description: "주문 총액"
          - name: status
            type: string
            enum: [pending, confirmed, shipped, delivered]
          - name: created_at
            type: timestamp

    - name: orders-metrics
      type: api
      format: rest
      location: https://api.internal/orders/metrics
      description: "주문 집계 메트릭 API"

  # 입력 소스 (의존성)
  inputPorts:
    - name: raw-orders
      type: database
      source: postgres://order-service-db
    - name: customer-data
      type: data_product
      source: customer-domain/customer-data-product

  # 데이터 품질 규칙
  quality:
    tests:
      - name: order_id_unique
        type: unique
        column: order_id
      - name: no_null_amounts
        type: not_null
        column: total_amount
      - name: valid_status
        type: accepted_values
        column: status
        values: [pending, confirmed, shipped, delivered]
      - name: freshness_check
        type: freshness
        column: created_at
        max_age: "24h"

  # 접근 제어 (연합 거버넌스)
  access:
    public: false
    classification: confidential
    teams:
      - name: analytics-team
        permissions: [read]
      - name: ml-team
        permissions: [read]
      - name: order-team
        permissions: [read, write, admin]

  # 문서 및 지원
  documentation:
    readme: docs/README.md
    wiki: https://wiki.company.com/orders-data-product
    slack: "#orders-data-support"

---
# 셀프 서비스 플랫폼: 인프라 자동 프로비저닝
# platform/terraform/data-product-infra.tf

resource "datamesh_data_product" "orders" {
  name   = "orders-data-product"
  domain = "order-management"
  owner  = "order-team@company.com"

  compute {
    type    = "spark"
    version = "3.5"
    size    = "medium"
    autoscaling {
      min_workers = 2
      max_workers = 10
    }
  }

  storage {
    type     = "delta"
    location = "s3://data-products/orders/"
    retention_days = 90
  }

  catalog {
    type      = "unity_catalog"
    namespace = "orders_domain"
    register_to_global = true
  }

  monitoring {
    enable_lineage = true
    alert_channels = ["slack:#orders-alerts"]
  }
}

Practical Conversation

CTO: The data team is a bottleneck. Data requests from every department are piling up at the central data team, so a 6-month queue has formed.
Data Architect: Let's consider adopting Data Mesh. If each domain team owns its own data products, the bottleneck goes away. The central team can focus on the platform and governance.
CTO: Do the domain teams have the data capabilities for that?
Data Architect: The self-service platform is the key. It abstracts away infrastructure complexity so that domain teams can build data products with just SQL and YAML. Start with 2-3 pilot domains at the beginning.
Interviewer: Please explain the difference between Data Mesh and a traditional data lake.
Candidate: In a traditional data lake, a central team collects, transforms, and serves all the data. In Data Mesh, each domain team owns its own data products and provides them to other teams through standardized interfaces. It is distributed like microservices, but consistency is maintained through federated governance.
Interviewer: What are the prerequisites for adopting Data Mesh?
Candidate: You need a large organization, clear domain boundaries, data capabilities in the domain teams, and a self-service platform. In small organizations the overhead can be greater, so a centralized approach is more efficient.

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

Developer: The data product definition has no inputPorts. How do we manage dependencies?
Senior: Good point. You need to specify the other data products that depend on inputPorts. That way lineage tracking is possible, and impact analysis is possible when an upstream product changes. Please add the customer-data-product dependency from customer-domain.
Developer: Should we define the SLA in more detail too?
Senior: Right. The data contract is complete only when you specify the SLA agreed with the consumer teams. In addition to latency and availability, let's add freshness (data freshness) and accuracy metrics too.

Cautions

  • Organizational culture change is more important than technology. Data Mesh is not a technical solution but an organizational paradigm shift.
  • In small organizations (10 or fewer data team members), the overhead can be greater. A centralized approach can be more efficient.
  • Distributing domains without a self-service platform deepens silos. Platform investment must come first.
  • Start with 2-3 pilot domains, build success stories, and expand gradually.
  • Automate federated governance policies as code. Manual review becomes a bottleneck.

Learn More