Key Idea: Relational databases are the default because they enforce structure and transactions. Everything in this topic is a deliberate trade away from those guarantees, in exchange for a shape of data or a scale that tables cannot serve.
Paper 1
- Short definitions and one comparison.
- State, outline, describe.
Paper 2
- Justify a choice for a described system.
- Evaluate, suggest, explain.
Both
- Name what the choice gives up, not only what it gains.
🗄️ Beyond tables
| Type | Stores as | Suits | Gives up |
|---|---|---|---|
| Document | Self-contained records | Fields that vary per row | Joins; duplication returns |
| Key-value | One key, one opaque value | Caches, sessions | Querying the value |
| Graph | Nodes and edges | Relationships as the question | Transactional strength |
| Column-family | Columns grouped | Huge tables, few columns read | Ad-hoc flexibility |
Important: These are trades, not upgrades. An answer choosing a non-relational store must say what about this data does not fit tables — and for money, the answer is usually still relational.
🏭 Data warehouses
Recording against analysing
- Operational databases take many small writes; warehouses take few enormous reads
- A warehouse keeps history; operational systems overwrite it
- ETL — extract from each source, transform to one consistent shape, load
- Denormalised on purpose, and safe because it is rebuilt in bulk rather than edited
- Current only to the last load — usually nightly, so never today's figures
Duplication is dangerous because of the update anomaly. A warehouse has no user updates — it is rebuilt wholesale — so the anomaly cannot arise. The rule is not wrong; the condition that makes it matter is absent.
🔍 OLAP and mining
| OLAP | Data mining | |
|---|---|---|
| You bring | A question | No question |
| It returns | The answer | Patterns you did not ask for |
| Operations | Drill down, roll up, slice, dice, pivot | Association, clustering, anomalies |
| Result is | A fact | A candidate, needing validation |
Important: Test thousands of combinations and some look significant by accident. A mined pattern must be checked on data that was not used to find it — and it reports co-occurrence, never cause.
🌍 Distributed databases
The two mechanisms and the one trade-off
- Replication keeps copies — availability and read speed
- Fragmentation splits the data — capacity and write throughput
- Real systems do both: shard to fit, replicate so no shard is a single failure
- During a network partition you must choose consistency or availability
- A bank chooses consistency; a social feed chooses availability. It is a business decision
📝 Exam-style questions
A retailer wants to keep a live shopping basket, analyse five years of sales, and answer "customers who bought this also bought…". Suggest a storage approach for each and justify your choices.
🔒 Model answer plan
See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.
Explain the consistency–availability trade-off, and why a bank and a social network resolve it in opposite directions.
🔒 Model answer plan
See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.
✅ Quick check
Cover the answers.
When does a graph database beat relational? When the relationships are the question — a traversal against a self-join per level.
Why is a warehouse denormalised? To avoid joins on huge analytical queries. Safe because it is rebuilt in bulk, never edited, so update anomalies cannot arise.
OLAP or mining — which brings its own question? OLAP answers a question you already have. Mining produces ones you did not ask.
Replication or fragmentation for capacity? Fragmentation — splitting the data. Replication gives availability, not capacity.
Which would a bank choose in a partition? Consistency — refusing is recoverable, allowing the same money to be taken twice is not.
Exam tips
- Say what about THIS data does not fit tables — that is the justification.
- Money still means relational. Knowing when NOT to move shows judgement.
- Denormalisation is safe in a warehouse because there are no user updates.
- Check lift, not just confidence — and a mined pattern is a candidate.
- Name the partition before naming the trade-off, then choose from the domain.