算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
data-data-mesh【设计与创意】Use this skill when asked about data mesh, data product, domain ownership, self-serve data platform, federated governance, data-as-a-product, compute-plane architecture, or data topology. This skill enforces: data mesh four principles (domain ownership, data as product, self-serve platform, federated governance), data product definition with input/ou…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Design data mesh architecture with domain-owned data products, self-serve platform capabilities, and federated governance — enabling decentralized data ownership at scale.
Exact user phrases: "data mesh", "data product", "domain ownership", "self-serve data platform", "federated governance", "data as a product", "compute plane", "data topology", "domain decomposition", "cross-domain data sharing".
Data mesh architecture with domain boundaries, data product designs (input/output ports), platform capability map, cross-domain data sharing model, and federated governance framework.
# Domain decomposition map
# Data product blueprint (ports, schema, SLA)
# Platform capability matrix
# Cross-domain sharing model
# Governance policies
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
350 lines of configuration.
| Domain | Business Capability | Data Products |
|---|---|---|
| Commerce | Order management, product catalog, cart | orders, products, carts |
| Finance | Revenue, billing, invoicing | revenue, invoices, payments |
| Marketing | Campaigns, attribution, leads | campaigns, attribution, leads |
| Operations | Inventory, fulfillment, logistics | inventory, shipments, suppliers |
| Customer | Profiles, segmentation, engagement | customer_360, segments, interactions |
Each domain owns all data it produces. No centralized data team owns domain data. Platform team owns infrastructure, not data.
Domain decomposition follows bounded context mapping from domain-driven design. Identify domains by business capability, not by organizational chart. One domain can span multiple teams. One team can own multiple domains only if they are small and related. Avoid splitting a single business capability across domains — this creates cross-domain join hell.
Decision tree for domain boundaries:
domain_decomposition:
domain: commerce
bounded_context: order_fulfillment
capabilities:
- name: order_management
data_produced:
- entity: orders
volume: "500K/day"
source: shop-api
- entity: order_items
volume: "1.2M/day"
source: shop-api
data_consumed:
- entity: products
from: catalog-domain
- entity: customer_360
from: customer-domain
- name: cart_management
data_produced:
- entity: carts
volume: "800K/day"
source: web-app
data_consumed:
- entity: inventory
from: operations-domain
domain_team:
size: 7
roles: [data-engineer(2), backend(3), analytics(1), product-manager(1)]
slack: "#domain-commerce"
maturity_assessment:
data_product_readiness: 4/5
documentation_coverage: 60%
sla_compliance: 99.2%
data_product:
name: orders
domain: commerce
version: "2.1.0"
description: "Order data product — all order transactions and line items"
input_ports:
- name: source_postgres
type: JDBC
config:
connection_string: "${POSTGRES_ORDERS_URI}"
sync_frequency: hourly
- name: events_topic
type: KAFKA
config:
topic: orders.events
consumer_group: dp-orders-ingestion
output_ports:
- name: analytics_tables
type: SNOWFLAKE
config:
database: PROD_DB
schema: COMMERCE_ORDERS
tables:
- fct_orders
- dim_order_items
- name: api
type: GRAPHQL
config:
endpoint: "https://data.orders.internal/v1/graphql"
authentication: mTLS
- name: stream
type: KAFKA
config:
topic: data-product.orders.published
retention_days: 30
schema:
format: AVRO
compatibility: BACKWARD
registry: "http://schema-registry:8081"
sla:
freshness: 15 minutes
availability: 99.9%
max_latency_ms: 500
ownership:
domain: commerce
team: orders-engine
steward: orders-dp@org.com
Each data product must have: input ports (how data is ingested), output ports (how data is consumed), schema, SLA, and ownership. Output ports must be discoverable via the catalog.
Data product design patterns:
| Capability | Tool | Owned By |
|---|---|---|
| Compute | Spark on K8s, Trino | Platform team |
| Storage | S3, Iceberg tables | Platform team |
| Orchestration | Airflow, Dagster | Platform team |
| Catalog | DataHub | Platform team |
| Schema Registry | Confluent SR | Platform team |
| Data Product API | Backstage + GraphQL | Platform team |
| Infrastructure | Terraform + Helm | Platform team |
| Monitoring | Monte Carlo, Prometheus | Platform team + domain |
| Governance | Global policies + domain policies | Governance council |
Platform provides the infrastructure and APIs. Domains use platform to build and operate their data products. Platform team does NOT own any domain's data.
Platform capability classification:
Define a clear interface contract between each plane and the domains. The platform team evolves these planes independently. Domains consume planes via APIs, not by accessing infrastructure directly.
Cross-domain sharing rules: consumer discovers data product via catalog. Producer grants access via ACL. Consumer agrees to contract terms. Producer notifies consumers of changes. All cross-domain data is read-only to consumers.
Data sharing topologies:
Never allow cross-domain direct database access. Only access through data product output ports. This preserves encapsulation.
Cross-domain data access patterns:
Each cross-domain data sharing relationship must have a documented data contract specifying schema, SLA, terms of use, and notification cadence for changes. The catalog serves as the contract registry.
| Policy | Global (Platform) | Local (Domain) |
|---|---|---|
| Schema compatibility | BACKWARD mode required | Extension-specific |
| PII classification | Standard categories | Domain-level tagging |
| Retention | Min 90 days, max 7 years | Domain-specific |
| Format | Iceberg + AVRO | Column naming conv |
| SLA tiers | Critical/High/Medium/Low | Thresholds within tier |
| Access control | RBAC framework | Domain-managed ACLs |
Global policies set by governance council (data architects + domain leads + compliance). Local policies defined per domain within global constraints.
Governance operating model:
All data products registered in catalog with: name, domain, description, owner, schema, output_ports, SLA, tags, quality_score. Consumers search catalog, view contract, request access. Access request → approved by domain owner → provisioned automatically.
| Level | Characteristics |
|---|---|
| 1: Centralized | Single data team owns all pipelines, data warehouse |
| 2: Domain-aware | Domain teams own some data, but platform is centralized |
| 3: Data mesh lite | Domain data products exist, platform self-serve enabled |
| 4: Full mesh | All domains have data products, federated governance active |
| 5: Optimized mesh | Automated data product lifecycle, AI-assisted governance |
Every data product must have a data contract that specifies schema, SLA, semantics, and ownership. The contract is the agreement between the producer domain and the consumer domain. Contracts are versioned, immutable after publication, and enforced automatically. The data contract is registered in the catalog alongside the data product metadata.
Monitor data product health across all domains: SLA compliance per data product, cross-domain data flow latency, data quality score trends, and catalog search effectiveness. Each domain monitors its own data products. The platform team monitors plane health. The governance council monitors overall mesh health.
New data sharing requirement
├── Single domain? → Keep internal, no data product needed
├── Cross-domain, read-only? → Consumer-aligned data product
├── Cross-domain, write-back? → Source-aligned data product + API
└── External partner? → Consumer-aligned + Delta Sharing
DRAFT → PUBLISHED (catalog visible) → ACTIVE (serving consumers)
→ DEPRECATED (30-day notice) → RETIRED (decommissioned)
Each state transition requires governance approval. DRAFT to PUBLISHED requires schema review and SLA definition. DEPRECATED triggers consumer notification. RETIRED removes output ports and archives metadata.
| Cost Type | Owner | Allocation Method |
|---|---|---|
| Storage | Platform | Per-domain usage (bytes stored) |
| Compute | Platform | Per-pipeline CPU-hours |
| Platform overhead | Platform | Flat charge per domain |
| Domain pipeline dev | Domain | Self-funded |
| Data product operation | Domain | Self-funded |
| Approach | Data Ownership | Governance | Best For |
|---|---|---|---|
| Data Mesh | Domain-owned | Federated | Large orgs, many domains, diverse data |
| Data Warehouse | Centralized IT | Centralized | BI/reporting, single source of truth |
| Data Lake | Centralized platform | Minimal | Data science exploration |
| Data Lakehouse | Centralized catalog | Centralized with RBAC | Unified batch + streaming |
| Data Fabric | Virtual integration | Automated | Heterogeneous sources, real-time |
Data mesh differs from data lakehouse primarily in ownership: mesh distributes ownership to domains, lakehouse centralizes under a data platform team. They can coexist: use lakehouse as the platform infrastructure, data mesh as the organizational model.
Data mesh vs data fabric: mesh requires domain ownership and organizational change. Fabric provides a virtual integration layer without changing ownership. Mesh is更适合 for organizations willing to reorganize around domains. Fabric is更适合 for organizations that want technical integration without org change.
Scalability: data mesh scales with domain count. Each domain operates independently so there is no central bottleneck. The catalog becomes the primary scalability concern — ensure catalog can handle metadata for 10,000+ data products. Platform compute plane auto-scales independently per workload type.
| Tool | Purpose | Integration Point |
|---|---|---|
| Backstage | Developer portal, data product lifecycle | Data product API, catalog |
| DataHub | Metadata catalog, lineage | Output port registration |
| Confluent SR | Schema registry, compatibility | Data product schema |
| Terraform | Infrastructure provisioning | Platform capability plane |
| Dagster/Airflow | Orchestration | Pipeline scheduling |
| Monte Carlo/Soda | Observability, quality | Data product SLA monitoring |
| OpenPolicyAgent | Policy engine | Global governance enforcement |
| GraphQL Federation | Data product API gateway | Cross-domain data access |
| dbt | Data transformation | Within-domain data product implementation |
| Trino | Federated query across domains | Cross-domain analytics |
| Delta Sharing | Cross-org data sharing | External partner access |
The platform tool stack must expose self-serve APIs. Domains should not need to know the underlying tool — they interact through abstractions (data product API, catalog UI, monitoring dashboard).
Data Mesh Adoption Path
├── Organizational readiness for domain ownership?
│ ├── Yes → Federated governance + domain teams
│ └── No → Start with centralized data platform first
├── Number of domains?
│ ├── < 5 domains → Start with single analytical domain
│ ├── 5-15 domains → Mesh with domain squads
│ └── > 15 domains → Full mesh with platform team
├── Existing data lake/warehouse?
│ ├── Yes → Migration: domain extraction from central lake
│ └── No → Greenfield: domain-native data products
└── Compliance requirements?
├── Strict → Federated governance with central guardrails
└── Lenient → Domain self-governance
Decision criteria: Assess organizational maturity, domain delineation, existing infrastructure, and governance appetite.
# data_mesh/data_product_contract.yml
data_product:
name: customer_360
domain: customer
owner: team-customer
version: "1.2.0"
maturity: production
schema:
- name: customer_id
type: string
required: true
pii: false
- name: email
type: string
required: true
pii: true
- name: total_spend
type: float
required: false
sla:
freshness: 1h
availability: 99.9%
access:
readers: [team-marketing, team-finance]
owners_only_write: true
# data_mesh/output_port.py
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
class DataProductQuery(BaseModel):
filters: dict = {}
columns: list[str] = ["*"]
limit: int = 1000
@app.post("/data-products/{domain}/{product}/query")
async def query_data_product(
domain: str, product: str, query: DataProductQuery
):
validate_access(domain, product, request.headers.get("Authorization"))
df = await read_data_product(domain, product)
result = apply_filters(df, query.filters)[query.columns].head(query.limit)
return result.to_dict(orient="records")
| Anti-Pattern | Consequence | Solution |
|---|---|---|
| Central governance committee | Bottleneck, defeats mesh purpose | Federated governance with minimal global rules |
| One domain owning shared data | Single point of failure, politics | Split into sub-domains or shared product |
| No data contract enforcement | Downstream breakage on schema change | CI checks on contract compatibility |
| No platform team | Each domain reinvents infrastructure | Dedicated platform squad with APIs |
| Treating mesh as tech problem only | Fails due to org resistance | Invest in change management and training |
data-data-platform for platform infrastructure. data-data-catalog for discovery. data-data-contracts for data product contracts. data-data-observability for cross-domain monitoring. data-data-quality for quality standards.