Files
semprini-data-product-templ…/canonical_data_product/product.yaml
T
paulandClaude Opus 5 866bcfe238 Add the source-aligned CDC template, and key the canonical template's topics
The first template of the source-aligned family: one data product per source
system, capturing a database by CDC and turning what it emits into what a
canonical product accepts. It runs on the Integration Bus, not in a domain, and
is deployed with the `data-bus` CLI.

What it produces, and what its tests hold it to: raw topics in the source's own
shape; deterministic identity, so a re-snapshot upserts rather than duplicating;
validation against the canonical product's rules before publishing, with what
fails going to the product's own dead-letter topic with the reason; keying by the
canonical identifier; provenance in headers; and an archive in the bus object
store that can be replayed back onto the raw topic.

The worked example captures an ERP customer table and delivers into Canonical
Party in the digital-core domain: 12 smoke checks, 37 unit tests, including a
poison record that is quarantined while the next record still arrives.

The canonical template's topics now declare the key producers must set, which is
the other half of that contract.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 10:54:39 +12:00

60 lines
2.4 KiB
YAML

# Data product manifest.
# Read by `uv run data-domain deploy|test|undeploy <product dir>`.
# Names every platform resource the product owns. Derived from the MD-DDL declaration
# named in `declaration`; see README.md in the template for the naming rules.
product:
name: "{{product.name}}" # MD-DDL level-3 heading, e.g. Canonical Party
slug: "{{product.slug}}" # kebab-case identity, e.g. canonical-party
domain: "{{domain.slug}}" # kebab-case domain, e.g. digital-core
declaration: "{{product.declaration}}" # e.g. data_products/canonical.md
version: "{{product.version}}" # from the declaration's `version`
owner: "{{product.owner}}" # from the declaration's `owner`
ods:
schema: "{{product.schema}}" # snake_case of slug, e.g. canonical_party
tables:
# >>> repeat per entity table, parents before children, association tables last
- name: "{{table}}" # e.g. party_role
entity: "{{entity.name}}" # e.g. Party Role
key: "{{table}}_id"
# <<< end repeat
graphql:
endpoint: "/rpc/{{product.schema}}_graphql"
smoke: graphql/smoke.graphql
events:
registry_group: "{{domain.slug}}.{{product.slug}}"
compatibility: BACKWARD
topics:
# >>> repeat per entity table
- name: "{{domain.slug}}.{{product.slug}}.{{table}}.inbound"
role: publish-input # producers publish canonical records here
table: "{{table}}"
key: "{{table}}_id" # producers MUST key by this: order holds per key, per partition
schema: events/schemas/{{table}}.schema.json
partitions: 3
cleanup_policy: delete
retention_ms: 604800000 # 7 days
- name: "{{domain.slug}}.{{product.slug}}.{{table}}.outbound"
role: subscribe-output # every change to the ODS table, keyed by {{table}}_id
table: "{{table}}"
key: "{{table}}_id" # set by the Flink upsert-kafka sink
schema: events/schemas/{{table}}.schema.json
partitions: 3
cleanup_policy: compact
# <<< end repeat
flink:
job: flink/job.sql
name: "{{product.slug}}"
lakehouse:
sync_group: ods # platform-level pg_duckpipe group pointing at the ODS
schema: "{{product.schema}}"
trino:
catalog: lake
smoke: trino/smoke.sql