{
  "name": "design",
  "version": "1.1.0",
  "description": "How the system is built, with no technology chosen: components, datastores, queues, interfaces, externals and the environments they run in. Enrichment packs (API detail, hosting, containers and the rest) attach to these nodes with details.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "dsn",
  "tier": "verified",
  "role": "core",
  "useWhen": "When you are deciding how the system is put together: its parts, where data lives and what it talks to.",
  "enriches": [],
  "requires": [
    "links@^1.0.0",
    "define@^1.0.0"
  ],
  "optional": [],
  "includes": [],
  "sha256": "d95c2ac2a9988de72814832d22460f84eadbd7bb816c96650df8cc51bb53a52b",
  "files": [
    [
      "dsn--design",
      "---\nid: dsn--design\ntype: plane\ntitle: Design\nfields:\n  order: 2\n  stack: Design\n  stack_at:\n  - 3\n  - 0\n  shapes:\n    component: square\n    datastore: database\n    environment: folder\n    external: cloud\n    interface: hexagon\n    queue: pipe\n  pack: design@1.1.0\n---\nThe parts of the system, what it depends on, where its data lives, how the parts talk, and the named places it runs. Technology-neutral: vendor, cloud and product detail goes in an enrichment stack.\n"
    ],
    [
      "dsn--link-type-consumes",
      "---\nid: dsn--link-type-consumes\ntype: link-type\ntitle: consumes\nfields:\n  name: consumes\n  description: Use to say that something relies on an interface, queue, external service or piece of configuration\n    to do its job.\n  inverse: consumed by\n  from: []\n  to: []\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--link-type-publishes",
      "---\nid: dsn--link-type-publishes\ntype: link-type\ntitle: publishes\nfields:\n  name: publishes\n  description: Use to say which component puts messages on a queue.\n  inverse: published to by\n  from:\n  - component\n  to:\n  - queue\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--link-type-reads",
      "---\nid: dsn--link-type-reads\ntype: link-type\ntitle: reads\nfields:\n  name: reads\n  description: Use to say which component reads data from a datastore.\n  inverse: read by\n  from:\n  - component\n  to:\n  - datastore\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--link-type-subscribes",
      "---\nid: dsn--link-type-subscribes\ntype: link-type\ntitle: subscribes\nfields:\n  name: subscribes\n  description: Use to say which component takes messages from a queue.\n  inverse: subscribed to by\n  from:\n  - component\n  to:\n  - queue\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--link-type-uses",
      "---\nid: dsn--link-type-uses\ntype: link-type\ntitle: uses\nfields:\n  name: uses\n  description: 'Use to say who or what calls on a component or interface: a person in a role, or an outside\n    system.'\n  inverse: used by\n  from:\n  - actor\n  - external\n  to:\n  - component\n  - interface\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--link-type-writes",
      "---\nid: dsn--link-type-writes\ntype: link-type\ntitle: writes\nfields:\n  name: writes\n  description: Use to say which component changes data in a datastore.\n  inverse: written by\n  from:\n  - component\n  to:\n  - datastore\n  pack: design@1.1.0\n---\n"
    ],
    [
      "dsn--pack",
      "---\nid: dsn--pack\ntype: pack\ntitle: Design\nfields:\n  name: design\n  namespace: dsn\n  version: 1.1.0\n  description: 'How the system is built, with no technology chosen: components, datastores, queues, interfaces,\n    externals and the environments they run in. Enrichment packs (API detail, hosting, containers and\n    the rest) attach to these nodes with details.'\n  license: Apache-2.0\n  publisher: trumly\n  role: core\n  starter-patterns:\n  - pub-sub\n  - event-hub\n  - decoupling-queue\n  - microservice\n  use-when: 'When you are deciding how the system is put together: its parts, where data lives and what\n    it talks to.'\n  requires:\n  - links@^1.0.0\n  - define@^1.0.0\n---\n"
    ],
    [
      "dsn--rule-component-owner",
      "---\nid: dsn--rule-component-owner\ntype: rule\ntitle: Components have an owner\nfields:\n  name: Components have an owner\n  statement: Every component has an owner\n  severity: error\n  applies_to:\n    type: component\n  check:\n    require_fields:\n    - owner\n  pack: design@1.1.0\n---\n**Why:** someone has to answer for it when it breaks or needs to change.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-component-runs",
      "---\nid: dsn--rule-component-runs\ntype: rule\ntitle: Components run somewhere\nfields:\n  name: Components run somewhere\n  statement: Every component runs in an environment\n  severity: warn\n  applies_to:\n    type: component\n  check:\n    require_link:\n      min: 1\n      node_type: environment\n      type: runs-in\n  pack: design@1.1.0\n---\n**Why:** a part that runs nowhere cannot be built or tested. Libraries and functions are the exception; they are shipped inside another component, so turn this off or ignore it for them.\n\n**Fix:** add a `runs-in` link to an environment.\n"
    ],
    [
      "dsn--rule-component-satisfies",
      "---\nid: dsn--rule-component-satisfies\ntype: rule\ntitle: Components serve a need\nfields:\n  name: Components serve a need\n  statement: Every component satisfies at least one requirement\n  severity: warn\n  applies_to:\n    type: component\n  check:\n    require_link:\n      min: 1\n      node_type: requirement\n      type: satisfies\n  pack: design@1.1.0\n---\n**Why:** a part that satisfies no requirement is either missing its requirement or not needed.\n\n**Fix:** add a `satisfies` link to a requirement, or write the missing requirement.\n"
    ],
    [
      "dsn--rule-datastore-owner",
      "---\nid: dsn--rule-datastore-owner\ntype: rule\ntitle: Data stores have an owner\nfields:\n  name: Data stores have an owner\n  statement: Every datastore has an owner\n  severity: error\n  applies_to:\n    type: datastore\n  check:\n    require_fields:\n    - owner\n  pack: design@1.1.0\n---\n**Why:** data without an owner has nobody deciding retention, backup and access.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-datastore-written",
      "---\nid: dsn--rule-datastore-written\ntype: rule\ntitle: Data stores are written to\nfields:\n  name: Data stores are written to\n  statement: Every datastore is written by a component\n  severity: warn\n  applies_to:\n    type: datastore\n  check:\n    require_link:\n      dir: in\n      min: 1\n      node_type: component\n      type: writes\n  pack: design@1.1.0\n---\n**Why:** a store nothing writes to is either unused or has an undrawn writer.\n\n**Fix:** add a `writes` link from the component that fills it.\n"
    ],
    [
      "dsn--rule-depends-on-acyclic",
      "---\nid: dsn--rule-depends-on-acyclic\ntype: rule\ntitle: No circular dependencies\nfields:\n  name: No circular dependencies\n  statement: Dependencies do not form a loop\n  severity: error\n  applies_to:\n    type: component\n  check:\n    acyclic: depends-on\n  pack: design@1.1.0\n---\n**Why:** if A needs B and B needs A, neither can start first.\n\n**Fix:** break the loop, usually by introducing a queue or moving shared logic into a third component.\n"
    ],
    [
      "dsn--rule-environment-used",
      "---\nid: dsn--rule-environment-used\ntype: rule\ntitle: Environments host something\nfields:\n  name: Environments host something\n  statement: Every environment hosts something\n  severity: warn\n  applies_to:\n    type: environment\n  check:\n    require_link:\n      dir: in\n      min: 1\n      type: runs-in\n  pack: design@1.1.0\n---\n**Why:** an environment nothing runs in is an unused place.\n\n**Fix:** add `runs-in` from the components, datastores or queues that run there.\n"
    ],
    [
      "dsn--rule-external-owner",
      "---\nid: dsn--rule-external-owner\ntype: rule\ntitle: Externals have an owner\nfields:\n  name: Externals have an owner\n  statement: Every external names who owns it\n  severity: error\n  applies_to:\n    type: external\n  check:\n    require_fields:\n    - owner\n  pack: design@1.1.0\n---\n**Why:** when it fails you need someone to ask.\n\n**Fix:** set owner.\n"
    ],
    [
      "dsn--rule-interface-exposed",
      "---\nid: dsn--rule-interface-exposed\ntype: rule\ntitle: Interfaces have a provider\nfields:\n  name: Interfaces have a provider\n  statement: Every interface is exposed by a component\n  severity: error\n  applies_to:\n    type: interface\n  check:\n    require_link:\n      dir: in\n      min: 1\n      node_type: component\n      type: exposes\n  pack: design@1.1.0\n---\n**Why:** an interface nobody offers cannot be called.\n\n**Fix:** add an `exposes` link from the component that offers it.\n"
    ],
    [
      "dsn--rule-interface-protocol",
      "---\nid: dsn--rule-interface-protocol\ntype: rule\ntitle: Interfaces name a protocol\nfields:\n  name: Interfaces name a protocol\n  statement: Every interface names its protocol\n  severity: error\n  applies_to:\n    type: interface\n  check:\n    require_fields:\n    - protocol\n  pack: design@1.1.0\n---\n**Why:** the protocol family decides what can talk to it.\n\n**Fix:** set protocol.\n"
    ],
    [
      "dsn--rule-must-requirement-satisfied",
      "---\nid: dsn--rule-must-requirement-satisfied\ntype: rule\ntitle: Musts are designed for\nfields:\n  name: Musts are designed for\n  statement: Every accepted must-have requirement is satisfied by a design node\n  severity: warn\n  applies_to:\n    priority: must\n    status: accepted\n    type: requirement\n  check:\n    require_link:\n      dir: in\n      min: 1\n      type: satisfies\n  pack: design@1.1.0\n---\n**Why:** an accepted must-have that nothing in the design satisfies is a promise nobody is keeping.\n\n**Fix:** add a `satisfies` link from the component, interface or datastore that delivers it.\n"
    ],
    [
      "dsn--rule-queue-ends",
      "---\nid: dsn--rule-queue-ends\ntype: rule\ntitle: Queues have both ends\nfields:\n  name: Queues have both ends\n  statement: Every queue has a publisher and a subscriber\n  severity: warn\n  applies_to:\n    type: queue\n  check:\n    require_link:\n    - dir: in\n      node_type: component\n      type: publishes\n    - dir: in\n      node_type: component\n      type: subscribes\n  pack: design@1.1.0\n---\n**Why:** a queue nobody writes to never delivers; one nobody reads from fills up.\n\n**Fix:** add `publishes` from the sending component and `subscribes` from the receiving one.\n"
    ],
    [
      "dsn--rule-service-in-use",
      "---\nid: dsn--rule-service-in-use\ntype: rule\ntitle: Services are in use\nfields:\n  name: Services are in use\n  statement: Every service is used, depended on or exposes something\n  severity: warn\n  applies_to:\n    kind: service\n    type: component\n  check:\n    any_of:\n    - require_link:\n        type: exposes\n    - require_link:\n        dir: in\n        type: uses\n    - require_link:\n        dir: in\n        type: depends-on\n    - require_link:\n        dir: in\n        type: consumes\n  pack: design@1.1.0\n---\nA service nothing calls and that offers nothing may be dead.\n\n**Fix:** link it with `exposes`, `uses`, `depends-on` or `consumes`, or remove it.\n"
    ],
    [
      "dsn--type-component",
      "---\nid: dsn--type-component\ntype: type\ntitle: component\nfields:\n  name: component\n  plane: dsn--design\n  description: 'Use for a part of the system that does work and that someone owns: a service, an app,\n    a scheduled job, a library or a function. Every component should satisfy a requirement.'\n  shape: square\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - service\n    - app\n    - job\n    - library\n    - function\n  - name: owner\n    kind: text\n    required: true\n  - name: status\n    kind: choice\n    required: true\n    values:\n    - proposed\n    - planned\n    - built\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** What are the separate parts that do the work? Who looks after each one?\n\nSplit by what changes together and who owns it, not by technology. Use `parent` to nest a part inside a bigger one when you need more detail. A component is not a Docker container: that is an `image` run as a `container`. Keep the title to a short label and say the rest in the description.\n\n**Watch:** a component with no owner, no requirement it satisfies, or nowhere it runs.\n"
    ],
    [
      "dsn--type-datastore",
      "---\nid: dsn--type-datastore\ntype: type\ntitle: datastore\nfields:\n  name: datastore\n  plane: dsn--design\n  description: 'Use for somewhere data lives between runs: a database, a cache, an object store, a search\n    index or a file area.'\n  shape: database\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - relational\n    - document\n    - key-value\n    - object\n    - search\n    - cache\n    - file\n  - name: owner\n    kind: text\n    required: true\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** Where does data live between runs? Who owns it? What would hurt to lose?\n\nOne datastore per thing with its own owner and lifecycle. The tables and fields inside it go in the data model enrichment stack.\n\n**Watch:** a datastore nothing writes to, or that two teams both think they own.\n"
    ],
    [
      "dsn--type-environment",
      "---\nid: dsn--type-environment\ntype: type\ntitle: environment\nfields:\n  name: environment\n  plane: dsn--design\n  description: Use for a named place the system runs, such as production, staging or a developer's machine.\n  shape: folder\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - production\n    - staging\n    - development\n    - test\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** Where does it run? Production, a test copy, a developer's machine?\n\nAn environment is a named place, not a technology. Which cloud, cluster or laptop realises it is described in a hosting enrichment stack.\n\n**Watch:** a component that runs nowhere.\n"
    ],
    [
      "dsn--type-external",
      "---\nid: dsn--type-external\ntype: type\ntitle: external\nfields:\n  name: external\n  plane: dsn--design\n  description: Use for a system or service outside this design that it depends on or that depends on it,\n    such as a payment provider or the company's sign-in service.\n  shape: cloud\n  fields:\n  - name: owner\n    kind: text\n    required: true\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** What do we rely on that we do not build or run? Who owns it?\n\nName an owner so there is someone to ask when it fails. An outside system that calls us is also an external, linked with `uses`.\n\n**Watch:** an external with no owner or no plan for when it is down.\n"
    ],
    [
      "dsn--type-interface",
      "---\nid: dsn--type-interface\ntype: type\ntitle: interface\nfields:\n  name: interface\n  plane: dsn--design\n  description: 'Use for a boundary other things talk to: an API, an event feed, a file format or a command\n    line.'\n  shape: hexagon\n  fields:\n  - name: protocol\n    kind: choice\n    required: true\n    values:\n    - http\n    - grpc\n    - graphql\n    - event\n    - file\n    - cli\n    - other\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** What do other things talk to? Who calls it, and in what style?\n\nThis is only the boundary: its name, who offers it and the protocol family. Endpoints, payloads and auth go in the API enrichment stack, linked with `details`.\n\n**Watch:** an interface nobody exposes, or two components talking with no interface between them.\n"
    ],
    [
      "dsn--type-queue",
      "---\nid: dsn--type-queue\ntype: type\ntitle: queue\nfields:\n  name: queue\n  plane: dsn--design\n  description: 'Use for a buffer or stream that carries messages between components without the sender\n    waiting: a queue, a topic or an event stream.'\n  shape: pipe\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - queue\n    - topic\n    - stream\n  - name: delivery\n    kind: choice\n    required: true\n    values:\n    - at-least-once\n    - at-most-once\n    - exactly-once\n  - name: body\n    kind: text\n    label: Description\n    required: true\n  pack: design@1.1.0\n---\n**Ask:** What needs to be handed from one part to another without waiting for an answer?\n\nA queue sits between a publisher and a subscriber. Say how delivery behaves, because it decides whether consumers must cope with duplicates.\n\n**Watch:** a queue with no publisher or no subscriber.\n"
    ],
    [
      "examples/ops-api-design/acceptance-criterion-status-shown",
      "---\nid: acceptance-criterion-status-shown\ntype: acceptance-criterion\ntitle: Status shown\nplane: def--requirements\nfields:\n  given: A job has just changed state\n  when: Operations staff open the job list\n  then: The new state is shown within 60 seconds\n  method: test\n---\n"
    ],
    [
      "examples/ops-api-design/actor-ops-staff",
      "---\nid: actor-ops-staff\ntype: actor\ntitle: Operations staff\nplane: def--capabilities\nlinks:\n- type: uses\n  to: component-ops-api\n---\n"
    ],
    [
      "examples/ops-api-design/assumption-job-volume",
      "---\nid: assumption-job-volume\ntype: assumption\ntitle: Job volume stays modest\nplane: def--intent\nfields:\n  statement: No more than 5,000 jobs run each night.\n  how-to-check: Count the nightly jobs for a month\n  owner: Platform team\n  state: open\n---\n"
    ],
    [
      "examples/ops-api-design/capability-view-job-status",
      "---\nid: capability-view-job-status\ntype: capability\ntitle: View job status\nplane: def--capabilities\nfields:\n  statement: view the current status of every job\n  scope: in\n  priority: must\n  status: proposed\nlinks:\n- type: derives-from\n  to: goal-timely-visibility\n- type: performed-by\n  to: actor-ops-staff\n- type: refers-to\n  to: concept-job\n- type: relies-on\n  to: assumption-job-volume\n---\n"
    ],
    [
      "examples/ops-api-design/component-ops-api",
      "---\nid: component-ops-api\ntype: component\ntitle: Ops API service\nplane: dsn--design\nfields:\n  kind: service\n  owner: Platform team\n  status: planned\nlinks:\n- type: exposes\n  to: interface-ops-api\n- type: writes\n  to: datastore-ops-db\n- type: publishes\n  to: queue-job-events\n- type: runs-in\n  to: environment-production\n- type: satisfies\n  to: requirement-status-freshness\n---\nServes job status to operations staff and records state changes.\n"
    ],
    [
      "examples/ops-api-design/component-ops-report",
      "---\nid: component-ops-report\ntype: component\ntitle: Nightly report job\nplane: dsn--design\nfields:\n  kind: job\n  owner: Platform team\n  status: planned\nlinks:\n- type: subscribes\n  to: queue-job-events\n- type: reads\n  to: datastore-ops-db\n- type: runs-in\n  to: environment-production\n- type: satisfies\n  to: requirement-status-freshness\n---\nBuilds the overnight summary from the recorded events.\n"
    ],
    [
      "examples/ops-api-design/concept-job",
      "---\nid: concept-job\ntype: concept\ntitle: Job\nplane: def--capabilities\nfields:\n  definition: A scheduled piece of work run for a customer.\n---\n"
    ],
    [
      "examples/ops-api-design/constraint-uk-eu-data",
      "---\nid: constraint-uk-eu-data\ntype: constraint\ntitle: Data stays in UK/EU\nplane: def--intent\nfields:\n  statement: Customer data stays in the UK or the EU.\n  kind: legal\n  source: Customer contracts\n  status: proposed\nlinks:\n- type: governs\n  to: capability-view-job-status\n---\n"
    ],
    [
      "examples/ops-api-design/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Operations database\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Platform team\n---\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-design/environment-production",
      "---\nid: environment-production\ntype: environment\ntitle: Production\nplane: dsn--design\nfields:\n  kind: production\n---\nThe live system that operations staff use.\n"
    ],
    [
      "examples/ops-api-design/example",
      "---\nid: example\ntype: example\ntitle: The ops API as components\nfields:\n  title: The ops API as components\n  description: Two components, the database they share, a queue between them, the interface and where\n    they run, each satisfying a requirement.\n  use: starter\n  requires:\n  - design\n  - define\n---\n"
    ],
    [
      "examples/ops-api-design/goal-timely-visibility",
      "---\nid: goal-timely-visibility\ntype: goal\ntitle: Timely visibility\nplane: def--intent\nfields:\n  statement: Operations staff see the state of every job within a minute.\n  status: proposed\nlinks:\n- type: measured-by\n  to: metric-status-freshness\n---\n"
    ],
    [
      "examples/ops-api-design/interface-ops-api",
      "---\nid: interface-ops-api\ntype: interface\ntitle: Ops API\nplane: dsn--design\nfields:\n  protocol: http\n---\nThe boundary operations tools call to read job status.\n"
    ],
    [
      "examples/ops-api-design/metric-status-freshness",
      "---\nid: metric-status-freshness\ntype: metric\ntitle: Job status age\nplane: def--intent\nfields:\n  kind: success\n  unit: seconds\n  direction: lower-is-better\n  target: 60\n  how-measured: Age of the newest status for each job, sampled every minute\n---\n"
    ],
    [
      "examples/ops-api-design/question-report-recipients",
      "---\nid: question-report-recipients\ntype: question\ntitle: Report recipients\nplane: def--intent\nfields:\n  state: open\n  raised-by: agent\nlinks:\n- type: about\n  to: capability-view-job-status\n---\nWho should receive the nightly report, and should it also be emailed?\n"
    ],
    [
      "examples/ops-api-design/queue-job-events",
      "---\nid: queue-job-events\ntype: queue\ntitle: Job events\nplane: dsn--design\nfields:\n  kind: queue\n  delivery: at-least-once\n---\nAnnounces each job state change so other parts can react.\n"
    ],
    [
      "examples/ops-api-design/requirement-status-freshness",
      "---\nid: requirement-status-freshness\ntype: requirement\ntitle: Status is fresh\nplane: def--requirements\nfields:\n  statement: The system shall show each job status no more than 60 seconds old.\n  kind: functional\n  priority: must\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\nlinks:\n- type: derives-from\n  to: capability-view-job-status\n- type: verified-by\n  to: acceptance-criterion-status-shown\n---\n"
    ],
    [
      "patterns/decoupling-queue/failed",
      "---\nid: failed\ntype: queue\nparent: queue\ntitle: Failed messages\nplane: dsn--design\nfields:\n  kind: queue\n  delivery: at-least-once\n---\nMessages that could not be processed after the retries. Nothing is lost: someone looks at them, fixes the cause and puts them back, or discards them on purpose.\n"
    ],
    [
      "patterns/decoupling-queue/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Decoupling queue\nfields:\n  title: Decoupling queue\n  description: A queue between a producer and a worker so the producer never waits and bursts are absorbed, with a place for messages that keep failing. Rename the nodes to your work, scale the workers, and link each component to a requirement and an environment.\n  use: starter\n  requires:\n  - design\n  root: queue\n  prefix: queue\n---\n"
    ],
    [
      "patterns/decoupling-queue/producer",
      "---\nid: producer\ntype: component\nparent: queue\ntitle: Producer\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: publishes\n  to: queue\n---\nPuts a piece of work on the queue and carries on without waiting for the result.\n"
    ],
    [
      "patterns/decoupling-queue/queue",
      "---\nid: queue\ntype: queue\ntitle: Work queue\nplane: dsn--design\nfields:\n  kind: queue\n  delivery: at-least-once\n---\nHolds work until a worker is free. The producer carries on as soon as the message is stored, and a burst waits here instead of overloading the worker. Say how long a message may wait and how many times it is retried.\n"
    ],
    [
      "patterns/decoupling-queue/reviewer",
      "---\nid: reviewer\ntype: component\nparent: queue\ntitle: Failure handler\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: failed\n---\nRaises an alert for each failed message so a person looks at it. Say who is on the hook in the owner.\n"
    ],
    [
      "patterns/decoupling-queue/worker",
      "---\nid: worker\ntype: component\nparent: queue\ntitle: Worker\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: queue\n- type: publishes\n  to: failed\n---\nTakes one message at a time and does the work. Make it safe to run the same message twice, because delivery is at least once. After the retries run out it moves the message to the failed queue.\n"
    ],
    [
      "patterns/event-hub/consumer-a",
      "---\nid: consumer-a\ntype: component\nparent: hub\ntitle: Consumer A\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: hub\n---\nReads the whole stream at its own pace and remembers how far it has got. Make it safe to read an event twice.\n"
    ],
    [
      "patterns/event-hub/consumer-b",
      "---\nid: consumer-b\ntype: component\nparent: hub\ntitle: Consumer B\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: hub\n---\nAn independent reader with its own position, for example one that rebuilds a report from the start while another keeps a live view.\n"
    ],
    [
      "patterns/event-hub/hub",
      "---\nid: hub\ntype: queue\ntitle: Event hub\nplane: dsn--design\nfields:\n  kind: stream\n  delivery: at-least-once\n---\nAn ordered, durable log. Events stay for a set time, so a new consumer can start from the beginning and a failed one can read again. Say how long events are kept and what decides their order (a key, such as the job id) in the description.\n"
    ],
    [
      "patterns/event-hub/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Event hub\nfields:\n  title: Event hub\n  description: A durable stream that producers append to and consumers read at their own pace, and can read again. Rename the nodes to your events, add a consumer for each reader, and link each component to a requirement and an environment.\n  use: starter\n  requires:\n  - design\n  root: hub\n  prefix: hub\n---\n"
    ],
    [
      "patterns/event-hub/producer",
      "---\nid: producer\ntype: component\nparent: hub\ntitle: Producer\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: publishes\n  to: hub\n---\nAppends events to the hub. It does not wait for anyone to read them.\n"
    ],
    [
      "patterns/microservice/api",
      "---\nid: api\ntype: interface\nparent: service\ntitle: Service API\nplane: dsn--design\nfields:\n  protocol: http\n---\nThe only way in. Say what callers can ask for and how it is secured. Add the detail with the api pack.\n"
    ],
    [
      "patterns/microservice/caller",
      "---\nid: caller\ntype: actor\nparent: service\ntitle: Caller\nplane: dsn--design\nlinks:\n- type: uses\n  to: api\n---\nWhoever asks the service for something: a person, another service or a scheduled job.\n"
    ],
    [
      "patterns/microservice/events",
      "---\nid: events\ntype: queue\nparent: service\ntitle: Service events\nplane: dsn--design\nfields:\n  kind: topic\n  delivery: at-least-once\n---\nWhat the service announces when its data changes, so other services can react without calling it.\n"
    ],
    [
      "patterns/microservice/listener",
      "---\nid: listener\ntype: component\nparent: service\ntitle: Listener\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: events\n---\nAnother service that reacts to the events and keeps its own copy of what it needs.\n"
    ],
    [
      "patterns/microservice/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Microservice\nfields:\n  title: Microservice\n  description: One service that owns its data, is reached only through its API, and announces what happened as events. Rename the nodes to your service, add the callers and listeners, and link each component to a requirement and an environment.\n  use: starter\n  requires:\n  - design\n  root: service\n  prefix: service\n---\n"
    ],
    [
      "patterns/microservice/service",
      "---\nid: service\ntype: component\ntitle: Service\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: exposes\n  to: api\n- type: writes\n  to: store\n- type: publishes\n  to: events\n---\nOwns one business capability end to end. It is the only thing that writes its datastore; everything else asks through the API or listens to the events.\n"
    ],
    [
      "patterns/microservice/store",
      "---\nid: store\ntype: datastore\nparent: service\ntitle: Service data\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Team\n---\nPrivate to the service: no other service reads or writes it directly. Other services get the data through the API or the events.\n"
    ],
    [
      "patterns/pub-sub/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Publish and subscribe\nfields:\n  title: Publish and subscribe\n  description: One publisher announces events on a topic and any number of subscribers each get a copy. Rename the nodes to your events, add a subscriber for each reader, and link each component to a requirement and an environment.\n  use: starter\n  requires:\n  - design\n  root: topic\n  prefix: topic\n---\n"
    ],
    [
      "patterns/pub-sub/publisher",
      "---\nid: publisher\ntype: component\nparent: topic\ntitle: Publisher\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: publishes\n  to: topic\n---\nAnnounces an event when something happens. It does not know who is listening, so adding a subscriber never changes it.\n"
    ],
    [
      "patterns/pub-sub/subscriber-a",
      "---\nid: subscriber-a\ntype: component\nparent: topic\ntitle: Subscriber A\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: topic\n---\nReacts to each event. Make it safe to receive the same event twice, because delivery is at least once.\n"
    ],
    [
      "patterns/pub-sub/subscriber-b",
      "---\nid: subscriber-b\ntype: component\nparent: topic\ntitle: Subscriber B\nplane: dsn--design\nfields:\n  kind: service\n  owner: Team\n  status: planned\nlinks:\n- type: subscribes\n  to: topic\n---\nA second, independent reader. It succeeds or fails without affecting subscriber A.\n"
    ],
    [
      "patterns/pub-sub/topic",
      "---\nid: topic\ntype: queue\ntitle: Events\nplane: dsn--design\nfields:\n  kind: topic\n  delivery: at-least-once\n---\nThe topic the publisher announces on. Every subscriber gets its own copy of each message, and a message is gone once it has been delivered, so a subscriber that was not there at the time misses it. Say what an event means in the description.\n"
    ]
  ]
}
