Chapter 18 · Capstone: Design a Production-Ready Database
Conceptual and Logical Model Review
Review and defend a conceptual and logical data model by checking entity boundaries, identifiers, cardinalities, optionality, temporal meaning, business rules, naming, and stakeholder readability.
Learning outcomes
A capstone model should be reviewed before implementation. The goal is not to admire the diagram; it is to challenge its meaning. Every entity, relationship, optionality marker, identifier, and temporal rule should trace back to a requirement.
Review entity boundaries and row grain.
Review cardinality, participation, and temporal meaning.
Review candidate keys and business identifiers.
Run a structured stakeholder/domain review.
Conceptual model sketch
AssetOwnership introduces time between Customer and Asset.
Review row grain
| Entity | One row means... |
|---|---|
| Customer | One tenant-scoped customer identity |
| Asset | One physical/serviceable asset |
| AssetOwnership | One ownership interval |
| WorkOrder | One repair/service case |
| Assignment | One technician-role interval on one order |
| PartUsage | One recorded use of one part on one order |
Entity boundary review
Ask whether any entity is merely an attribute group with no independent identity or lifecycle. Conversely, ask whether repeated facts are hidden inside columns or JSON and deserve their own entity.
Customer and Asset
Current relationship alone:
is insufficient if ownership history matters. Logical model:
with temporal non-overlap constraints.
WorkOrder and Technician
Many technicians can work on many WorkOrders over time. The associative entity WorkOrderAssignment stores:
role_codestarted_atended_atis_primary / role semanticsPartUsage is not a direct M:N shortcut
PartUsage carries facts:
quantitycharged_unit_pricerecorded_atrecorded_byTherefore it is a first-class associative entity.
Optionality review
Questions:
- Can an Asset exist before owner assignment?
- Can WorkOrder exist before technician assignment?
- Can a WorkOrder have zero PartUsage?
- Can a DiagnosticCapture exist without a WorkOrder?
Optionality should reflect workflow, not drawing convenience.
Candidate keys
| Entity | Surrogate PK | Alternate key |
|---|---|---|
| Customer | customer_id | (tenant_id, customer_number) |
| Asset | asset_id | (tenant_id, manufacturer_id, serial_number) |
| WorkOrder | work_order_id | (tenant_id, work_order_number) |
| Part | part_id | (tenant_id, sku) |
| Technician | technician_id | (tenant_id, employee_number) |
Tenant ownership
Decide whether tenant_id is:
- stored on every tenant-owned table;
- part of composite unique constraints;
- part of tenant-aware foreign keys;
- used in row-level security and indexes.
Temporal review
For AssetOwnership:
valid_from inclusivevalid_to exclusiveat most one active owner per assetbackdating allowed?future-dated ownership allowed?These are model rules, not implementation details.
Status review
Separate:
WorkOrder.status_code -- current stateWorkOrderStatusEvent -- transition historyWorkOrderStatus -- reference metadataEach has a different role.
Reference data review
Candidate reference entities:
- WorkOrderStatus;
- AssignmentRole;
- FailureCategory;
- PartCategory;
- DiagnosticSeverity.
JSON boundary review
DiagnosticCapture.payload_json is acceptable because payloads vary by source. But promote:
captured_atsource_systemschema_versionseverity_codeinto stable typed columns.
Naming review
Use consistent names:
customer_idwork_order_idopened_atclosed_atstatus_codevalid_fromvalid_toAvoid synonyms such as customer/account/client unless they mean different concepts.
Diagram readability review
Create one conceptual diagram for business stakeholders and a separate logical diagram for engineering detail. Do not overload one diagram with every index, data type, and audit column.
Stakeholder walkthrough
Use scenarios:
- Customer buys an Asset.
- Asset changes owner.
- WorkOrder is opened.
- Two technicians are assigned.
- Parts are consumed.
- WorkOrder closes.
- Auditor asks who changed status.
If the model cannot narrate these scenarios clearly, it is not ready.
Model-review checklist
- Every entity has one clear grain.
- Every relationship has named semantics.
- Cardinality and optionality are explicit.
- Business keys are identified.
- Temporal facts are not overwritten accidentally.
- Tenant boundaries are visible.
- JSON does not hide core relations.
- Reference data has ownership.
Checkpoint
Spot the modeling error
WorkOrder has columns technician1_id, technician2_id, technician3_id. Why is this poor design?
Review answer
It encodes a repeating relationship into fixed columns, imposes an arbitrary maximum, complicates role/timing attributes, and violates the natural many-to-many relationship. Use WorkOrderAssignment.
Summary and next lesson
A logical model is ready when its grain, keys, cardinalities, time semantics, and ownership rules survive stakeholder scenarios and engineering scrutiny. The next lesson normalizes and implements this model as a relational schema.
References
- Course Chapters 2–5 for entity, relationship, notation, and relational mapping.
- Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems.
- Thomas Connolly and Carolyn Begg, Database Systems.