name: design-a-data-model-for-a-feature
description: Model a feature's entities, relationships, invariants, indexes, and lifecycle states. Use when the user needs a concrete data model for a new feature or a change to existing data.
domain: architecture-design
tags: [data-model, entities, constraints]
triggers: ["feature data model", "design a database model", "entity relationship design for a feature"]
Model a feature's entities, relationships, invariants, indexes, and lifecycle states
Purpose
Model a feature's entities, relationships, invariants, indexes, and lifecycle states.
When to use
Use when the user needs a concrete data model for a new feature or a change to existing data.
When NOT to use
Do not use this for a local implementation detail; use software-engineering instead.
Inputs required
- The functional and non-functional requirements
- The constraints on scale, budget and timeline
- The existing systems the design must fit
Procedure
- Translate the feature requirements into entities, attributes, relationships, and ownership.
- Define keys, nullability, constraints, referential rules, and lifecycle state transitions.
- Specify the queries the feature must perform and the indexes that support them.
- Capture invariants and the transaction boundaries that preserve them.
- Document expected volumes, growth, archival, retention, and deletion behavior.
- List assumptions about data quality and migration impact before approving the model.
Output contract
A design with components, interfaces, data flows, failure modes and a migration path.
Validation checklist
Safety notes
Never present a design as final without stating the assumptions it depends on.
Related skills
design-a-multi-tenant-data-model
design-a-permission-model
design-a-batch-processing-pipeline
1---2name: design-a-data-model-for-a-feature3description: Model a feature's entities, relationships, invariants, indexes, and lifecycle states. Use when the user needs a concrete data model for a new feature or a chang4---5---6name: design-a-data-model-for-a-feature7description: Model a feature's entities, relationships, invariants, indexes, and lifecycle states. Use when the user needs a concrete data model for a new feature or a change to existing data.8domain: architecture-design9tags: [data-model, entities, constraints]10triggers: ["feature data model", "design a database model", "entity relationship design for a feature"]11---1213# Model a feature's entities, relationships, invariants, indexes, and lifecycle states1415## Purpose1617Model a feature's entities, relationships, invariants, indexes, and lifecycle states.1819## When to use2021Use when the user needs a concrete data model for a new feature or a change to existing data.2223## When NOT to use2425Do not use this for a local implementation detail; use software-engineering instead.2627## Inputs required2829- The functional and non-functional requirements30- The constraints on scale, budget and timeline31- The existing systems the design must fit3233## Procedure34351. Translate the feature requirements into entities, attributes, relationships, and ownership.362. Define keys, nullability, constraints, referential rules, and lifecycle state transitions.373. Specify the queries the feature must perform and the indexes that support them.384. Capture invariants and the transaction boundaries that preserve them.395. Document expected volumes, growth, archival, retention, and deletion behavior.406. List assumptions about data quality and migration impact before approving the model.4142## Output contract4344A design with components, interfaces, data flows, failure modes and a migration path.4546## Validation checklist4748- [ ] Every requirement maps to a component49- [ ] Failure and rollback paths are described50- [ ] The trade-offs behind the choice are written down5152## Safety notes5354Never present a design as final without stating the assumptions it depends on.5556## Related skills5758- `design-a-multi-tenant-data-model`59- `design-a-permission-model`60- `design-a-batch-processing-pipeline`