Data Discovery

From "customer places an order containing products" to Customer, Order, OrderItem, Product. Entities from plain English, what must persist, and snapshots against references.

Data Discovery

"Customer places an order containing products" is already a data model: Customer, Order, OrderItem, Product. Entities are the nouns, relationships are the verbs, and the hidden entity is the one the sentence needs but does not name.

Q · Before I design a database, how do I find out what data this system is actually about?
Entities From Requirements

A requirement is a source of entities only if it is read for them. The rule is a noun the system must remember; the traps are nouns that are really attributes, attributes that are really entities, and the entity you only find by asking "one or many?".

Q · Given a list of requirements, how do I decide which nouns deserve to be entities, which are attributes, and which are neither?
Data Modelling From Plain English
▶ lab

"Users can create projects and invite members" hides User, Project, Membership and Invitation — two of which are verbs. The move is to read requirements as data until a first schema falls out, then hand the schema to Database Engineering to make it correct.

Q · How do I get from a sentence a non-engineer wrote to a first schema I could actually create, without designing a database I do not yet understand?
What Must Persist

Not everything the system knows must survive a restart. Orders must; a cart may; a product's "in stock" badge is recomputed. Sorting data into must-persist, may-persist and recompute is what keeps the schema small and the losses acceptable.

Q · Of everything this system holds in memory at some moment, what must still be there after a restart, what may be lost, and what should be recomputed rather than stored?
Snapshots vs References

The price the customer paid lives on OrderItem, not on Product. Whenever a fact was true at a moment and the thing it refers to can change, the fact is a snapshot; a reference is right only when the current value is the one wanted.

Q · When one entity refers to another, should it hold a reference to the current thing or a copy of the thing as it was — and how do I tell which?