Registry Designer
A registry is not a table. It is the authoritative living representation of a domain — the single place that owns a class of truth. Creating one is the most expensive architectural act available, because every future system will read from it and trust it.
Default answer: no new registry. Make the request earn it.
Hard rules
- One fact, one owner. Two registries owning the same fact is a defect, always.
- A registry that only stores rows is a table. Send it back.
- Copied fields are forbidden. Relate, don't replicate.
- A registry with no events is inert storage, not a registry.
- Never create a registry to solve a read problem. Reads are projections.
The Universal Registry test
A concept deserves a registry only if it can exist, change, interact, be measured, be trusted, be owned, be learned from, or influence another system — and the resulting registry can meet every one of these:
- possesses a unique, stable identity;
- maintains complete event history and provenance;
- maintains relationships with every relevant registry;
- publishes to the event spine, and subscribes only to what its responsibilities require;
- is fully auditable;
- supports reasoning over it without that reasoning becoming the source of truth.
Fail any one and it is not a registry. It is a field, a view, a branch, or an event type on an existing registry.
Decision order
1. extend an existing registry add the field, relationship or event type
2. generalise an existing registry widen the concept so both cases fit
3. branch under an existing layer a bounded sub-domain with its own module,
reading identity from its parent registry
4. new registry (last resort) explicit owner, purpose, event contractJustify each step down against the one above it, in writing. "It felt cleaner" is not a justification.
When to generalise rather than extend
Generalise when a second case arrives that the first registry almost fits, and the mismatch is naming rather than behaviour. contractor and employee are usually one person registry with a relationship type. residential_property and commercial_property are usually one property registry with a classification.
Stop generalising when the two cases have genuinely different lifecycles, different owners, or different event vocabularies. A generalisation that needs a type column plus six conditional branches has gone too far.
Ownership and normalisation
Absorbed capability: the architectural half of the proposed entity-normalizer. The mechanical half — scanning for duplicate storage — is tooling/doctrine-linter, not prose.
For every field on the proposed structure, ask:
- Does this fact already live somewhere? If yes, hold a reference, not a copy.
- Who answers for it when it is wrong? That module owns it. Exactly one does.
- Is it a fact, or a derivation? Derivations are computed or projected, never stored as truth. A stored derivation drifts, and nothing tells you when.
- Is it a current value that hides a history?
status,assigned_to,pricealmost always do. Model the change as an event; expose the current value as a projection. - Would two rows ever disagree? Then the shape is wrong before it ships.
Denormalisation
Permitted only as an explicitly labelled cache with a named refresh path and a named owner, never as the source of a read that matters. If you cannot name what invalidates it, do not build it.
Worked example
Request: "we need a Supplier registry."
- Search. A
personregistry exists withrelationship_typeincludingcustomerandsubcontractor. Acompanyregistry exists. No supplier concept. - Universal Registry test. A supplier can exist, change, be measured, be trusted, be owned. Identity: yes. Events:
supplier.onboarded,quote.received,delivery.failed. Relationships: to jobs, to properties, to invoices. Auditable: yes. It passes. - Decision order. Step 1: can
companybe extended? A supplier is a company with a supply relationship. The distinguishing facts — lead times, price lists, reliability history — attach to the relationship, not to the company. - Outcome. No new registry. Extend
company; add asupply_relationshipbranch owning terms and reliability events. One company that is both a supplier and a customer stays one row, which the separate-registry design would have made impossible without duplicate storage. - What would change the answer. If suppliers were later sourced from an external trade directory with their own identity space and lifecycle, that is a federation boundary — see
federation-contract-author, still not a second company registry.
Pressure tests
- Name the one module that answers for each field. Any field with two names or none fails.
- If this registry were deleted, which facts would be unrecoverable? If the answer is "none, they all live elsewhere", it should never have existed.
- Can two rows in this system disagree about the same real-world fact?
- Does every field that can change over time have an event that records the change?
- Is any stored value computable from other stored values?
Stop conditions
- The proposed registry duplicates a fact another registry owns — refuse, state where the fact lives.
- Ownership cannot be assigned to exactly one module — the boundary is wrong; split or merge before proceeding.
- The concept fails the Universal Registry test but a registry is still requested — implement it as a branch or projection and say why.
- The proposal is justified by read performance alone — build the projection.