Skip to main content

Node Topology

node-topology is the Supporting bounded context of the retail network (area Network, CloudEvents tier logistics) that owns the network's shape. It is the authoritative registry of the buildings the network runs through (fulfilment centres, inbound cross-docks, returns centres, sortation centres, delivery stations and air hubs), what each building declares it can do (a versioned, immutable operational profile), the directed lanes between active nodes, the regions that partition the network, and which delivery station serves which postal prefix.

It sits at the root of the network's dependency graph. A delivery promise is a claim about a path: this node can have the package ready by this cutoff, a departure leaves on this lane, this station serves this prefix. If two contexts held two copies of "which station serves 01310", the network would promise from one and route from the other. Node Topology is the single owner of those facts, publishes every change as a CloudEvent on retailnetwork.node-topology.events through a transactional outbox, and the neighbours keep their own read models of it. It consumes no Kafka topic and calls no sibling context (ADR 0001, ADR 0003).

:::info What runs on develop Three binaries are built from one module and one image: cmd/api (REST, migrations, the outbox relay), cmd/mcp (a read-only MCP server, ADR 0008) and cmd/a2a (a read-only A2A agent, ADR 0011). A web console remote lives in web/ (ADR 0009). It runs on real Postgres and, for the api, real Kafka only: there is no in-memory runtime. REST, MCP and A2A are unauthenticated; reachability is the cluster and gateway boundary. Packaging is the Helm chart charts/node-topology; see Before the first release for what is still open. :::

What the context owns​

AggregateWhere it livesRule in one line
Nodeinternal/domain/nodeOne physical building, of one of six types, run by the NETWORK or a VENDOR. Lifecycle PROPOSED to ACTIVE, SUSPENDED, RETIRED (terminal). Capabilities derive from the type, never from the caller.
OperationalProfile (inside Node)internal/domain/nodeAppend-only revisions: operating hours by weekday, holidays, handling time, cutoffs, throughput cap, sort dwell (sortation centres and air hubs only), optional inbound limits. A new declaration never edits an old revision.
Laneinternal/domain/laneA directed, mode-specific (GROUND or AIR) connection between two different ACTIVE nodes along an allowed type pair; OPEN to CLOSED, no reopen.
ServiceAreainternal/domain/serviceareaWhich ACTIVE delivery station serves a postal prefix, versioned by assignmentVersion; no unassign.
Regioninternal/domain/regionA partition of the network with a unique code; defined once, never renamed or removed.

What it does not own​

Not hereOwner
Scheduled departures on a lane, their capacity and loads (a lane holds only the nominal transit time)linehaul-transportation
Waves and routes inside a station's service arealast-mile-delivery
Measured performance and grades of a node (this context holds the declared half of a node's capability only)node-performance
What a node can sell, and how muchoffer-availability
Vendor accounts, ack windows and the Vendor APIvendor-connectivity
Which node should hold which item before demand arrivesnobody yet (gap G49 in the network model)
Suspending a node because it performs badlynobody automatically: a planner decides

Classification and tier​

  • Supporting subdomain, evolution custom-built, business model enabler: every decision depends on the registry, but nobody chooses a network for how it stores its node list. The parcel-node rule and the versioned profile are specific to this network, so it is not Generic (Subdomain classification).
  • Area Network, CloudEvents tier logistics: types look like com.retailnetwork.logistics.node-topology.<entity>.<EventName>.

Main capabilities​

  1. Register nodes (POST /nodes), vendor nodes through vendor-connectivity and parcel nodes by a network-ops planner, with the operator, subtype and region rules enforced.
  2. Declare operational profile revisions (PUT /nodes/{nodeId}/operational-profile), and move nodes through activate, suspend and retire.
  3. Open and close lanes, declare the cost of a lane, define regions and assign postal prefixes to delivery stations under a strictly increasing assignmentVersion.
  4. Answer the reads of the network: GET /nodes, GET /nodes/{nodeId}, GET /lanes, GET /service-areas/{postalPrefix}, GET /regions, over REST, MCP tools and two A2A skills.
  5. Publish the ten events of the four aggregates, at least once and in order per aggregate, through the transactional outbox.
  6. Make every write retry-safe with the Idempotency-Key header (24 h).

Ten commands change state (Use cases); everything else is a read.

Where to go next​

You want toRead
See the layers, binaries, ports and the rules that police themArchitecture, Runtime
Run it and make the first callsQuickstart
Know every settingConfiguration
Deploy and operate itRunbook, Observability, Before the first release
Fix something that brokeTroubleshooting
Know what tests and CI gates existTesting
See who talks to whomIntegration
See the use cases and their invariantsUse cases
Read the design as ddd-crew artifactsDDD artifacts, Ubiquitous language
Read the contractsAPI overview, Event catalogue, MCP tools
Read the decisionsADR index

Published at https://iqvo.github.io/node-topology/.

Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.