Wrap-up and resources
Final recap
- 1. Why draw: Each diagram answers one question you can write in a line. Its value is catching contradictions before the code, as we caught that a member borrows a copy rather than a book, with no code at all.
- 2. Use cases: Who wants something and what it is. Verb + object from the actor's point of view. And «include» always becomes a call in the path, while «extend» sometimes becomes a conditional branch.
- 3. Classes: Multiplicity is the business rule:
0..1prevents a copy being borrowed twice and0..*allows it. And executing the diagram proved all four rules and exposed a bug in their order. - 4. Sequence and activity: Order is behaviour, not structure. The activity diagram ordered the refusal conditions narrowest-to-fix first, turning the misleading “you are at the limit” into the correct “you are overdue”.
- 5. Data models: The model follows the question. Over 300,000 relationships: the scan took 19.37 ms, the index 0.01, and the graph traversal 0.01, the same number, so the win came from the access shape.
- 6. Choosing by evidence: Reading from the document was 205 times faster, and one rename made 12 documents stale. The trade is read speed against update cost, and keep one source of truth.
The thread connecting all sixIn every part there was a popular opinion, and every time we replaced it with a number or a run: “a member borrows a book” became a copy, “the rules are there” became their order is wrong, “a graph is faster” became the same time as an index, and “documents are 205× faster” came with 12 stale documents. Design is neither taste nor memorised notation: it is the habit of asking for evidence before deciding.
Complete glossary
| Term | Definition | Part |
|---|---|---|
| UML | A standard drawing language for describing a system, agreed notation, not a programming language. | 1 |
| Structural / behavioural | The two diagram families: what exists, versus what happens and in what order. | 1 |
| Actor | A role outside the system boundary wanting something from it, possibly a system or a clock. | 2 |
| Use case | A complete goal ending in value for the actor, named verb + object. | 2 |
| «include» / «extend» | A step that always happens, versus behaviour added on a condition. | 2 |
| Multiplicity | The number on a relationship line: 1, 0..1, 0..*, and it *is* the business rule. | 3 |
| Association class | A relationship carrying data of its own, so it becomes a class, such as a loan with its dates. | 3 |
| Composition / aggregation | The part dies with the whole (filled diamond), versus it moving on (hollow diamond). | 3 |
| Lifeline | A vertical column for a participant in a sequence diagram, with time running down. | 4 |
| The alt frame | A conditional branch in a sequence diagram, and where refusal paths belong. | 4 |
| The diamond | A decision node in an activity diagram, that is an if in code. | 4 |
| The self-call | An arrow back to the same column: the rule lives in this component. | 4 |
| Normalisation | Storing every fact in one place and reassembling it at read time with joins. | 5 |
| Key-value | One key → a value the store does not understand: sessions, caches, counters. | 5 |
| Document | A record as a JSON tree whose inside the store understands, for a record you read whole. | 5 |
| Column family | Wide sparse rows read by column, time series and measurements. | 5 |
| Graph | The relationship as a first-class record, for a question whose subject is the relationship. | 5 |
| Depth explosion | Exponential growth in traversal results: 15 → 225 → 3,065 → 14,971. | 5 |
| Access pattern | Your most frequent questions and their proportions, the first thing to write before choosing a model. | 6 |
| Staleness | The gap between an original and its copy, a bounded, monitored decision rather than a bug. | 6 |
| Source of truth | The model the others are derived from and can be rebuilt from. | 6 |
| Read-to-write ratio | The number that decides whether duplication justifies itself. | 6 |
Sources
The best outside resources for these lessons, classified by kind and level. All are open to everyone and need no account on any platform. Use the filters to narrow the list.
0 resources
Interactive tools (3)
Interactive toolMermaid, Diagrams as TextThe tool every figure in this guide was drawn with. You write the diagram as text and it renders, so it reviews in git like any code.mermaid.js.orgBeginnerInteractive toolMermaid Live EditorA live editor for writing UML diagrams as text and previewing them instantly before saving an .mmd file.mermaid.liveBeginnerInteractive tooldbdiagram.ioYou type tables and relationships in a simple text language and it draws the ER diagram instantly. The fastest way to try a design before committing to it.dbdiagram.ioBeginner
Official documentation (17)
Official docsThe Official UML Specification (2.5.1)The reference every symbol derives from. Heavy to read front to back, and irreplaceable when a symbol's meaning is disputed.omg.orgBeginnerOfficial docsThe GitHub GlossaryA quick reference for the branch and commit vocabulary that appears in use case narratives and sequence diagrams.docs.github.comBeginnerOfficial docsMermaid, Class Diagram SyntaxHow to write multiplicity and the four line kinds as text. This page is literally what part three used.mermaid.js.orgIntermediateOfficial docsPostgreSQL, Constraints and Foreign KeysHow multiplicity becomes a real constraint: UNIQUE, NOT NULL and ON DELETE CASCADE, that is part three's composition.postgresql.orgIntermediateOfficial docsPython Docs, datetime and timedeltaWhat we used in executing the class diagram to compute due dates and overdue state.docs.python.orgIntermediateOfficial docsMermaid, Sequence Diagram SyntaxThe alt, loop and opt frames, and the self-call. Look up alt specifically, it is where refusal paths belong.mermaid.js.orgIntermediateOfficial docsMermaid, Flowchart SyntaxThe diamonds and rounded nodes we draw activity diagrams with. Every diamond here is an if in your code.mermaid.js.orgIntermediateOfficial docsPostgreSQL, IndexesThe chapter explaining what part five measured: why an index turns a full scan into a read by key.postgresql.orgAdvancedOfficial docsMongoDB, Data Modeling IntroductionEmbedding versus referencing: the same decision we measured in part six (205× against 12 stale documents).mongodb.comAdvancedOfficial docsRedis, Data TypesWhat a key-value store is genuinely good for. Read the list and you will see “key-value” is not primitive but specialised.redis.ioAdvancedOfficial docsApache Cassandra, Column-Family ModellingDesign starts from the query rather than from the entities. The clearest official statement of “the shape follows the question”.cassandra.apache.orgAdvancedOfficial docsNeo4j, Graph Data ModelingThe relationship as a first-class record, with a six-step process and a glossary. Read it alongside part five's measurement.neo4j.comAdvancedOfficial docsNeo4j, Cypher Core ConceptsNodes, relationships and paths with Cypher examples. From here you move to the path syntax to bound the depth, a correctness condition, as part five showed.neo4j.comAdvancedOfficial docsMongoDB, data modelingThe rule the document model rests on, "data that's accessed together should be stored together", and embedding versus referencing.mongodb.comIntermediateOfficial docsPostgreSQL, Reading a Plan with EXPLAINThe tool that turns “the query is slow” into a specific cause. The first thing to use before any decision to change the model.postgresql.orgAdvancedOfficial docsMongoDB, Schema Design Anti-PatternsWhat happens when the document model is used for a question it does not fit: unbounded arrays, and embedding what should have been referenced.mongodb.comAdvancedOfficial docsPython Docs, perf_counter for MeasurementThe function every number in parts five and six was measured with. Read about it before publishing a number you measured yourself.docs.python.orgAdvanced
Articles and explainers (7)
ArticleUML as Sketch, Martin FowlerThree ways to use UML: as sketch, as blueprint, as programming language. Explains why “complete documentation” attempts fail.martinfowler.comBeginnerArticleUse Case Diagrams, An Illustrated ReferenceMany examples of actors, boundaries, include and extend. Faster than the formal specification when you need an example rather than a definition.uml-diagrams.orgBeginnerArticleAnemic Domain Model, Martin FowlerThe mistake that leaves your classes as fields with no behaviour and the rules scattered outside them. Read it after executing part three's diagram.martinfowler.comIntermediateArticleClass Diagrams, An Illustrated ReferencePictures of every line kind and multiplicity, including the association class. Very useful for telling composition from aggregation by eye.uml-diagrams.orgIntermediateArticle“The Future is: NoSQL Databases, Polyglot Persistence”, Fowler and SadalageAn even-handed slide deck on the four families and why they exist, with no vendor enthusiasm, and the idea that one system uses more than one store.martinfowler.comAdvancedArticleCQRS, One Model to Read, Another to WriteThe formal name for what we did in part six: a derived read shape over a write source of truth. Note Fowler's warning against using it without need.martinfowler.comAdvancedArticleJepsen, The Consistency Models MapThe most precise practical reference for what “consistency” actually means, which is what makes “how many seconds of staleness?” answerable.jepsen.ioAdvanced
- Every number in parts 3, 4, 5 and 6 is the real result of running Python on the code shown, none of it is hand-written.
Resources for this lesson
Grouped by type. Start with the official docs for precision, or an article or video for the explanation.
Official docs1
Done with this lesson?
Sign in to save your progress.