The big idea: A distributed database spreads data across several machines, often in different places, while appearing to users as one database.
The reason is usually simple: the data no longer fits on one machine, or the service cannot afford that machine failing.
| Replication | Fragmentation (sharding) | |
|---|---|---|
| Does | Keeps copies of the same data | Splits the data between machines |
| Helps with | Availability and read speed | Capacity and write throughput |
| A machine fails | Another copy serves it | That portion is unavailable |
| Cost | Copies must be kept in step | A query spanning shards is expensive |
Most real systems do both: Shard to fit the data, then replicate each shard so no single failure loses a portion. The two solve different problems and are not alternatives.
Free preview
This is the free notes preview
You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:
- FlashcardsLock in vocabulary and key terms with spaced repetition.
- Practice questionsAnswer exam-style questions and get instant AI marking.
- Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
- Personalised study planA daily plan built around your exam date and weak areas.
Availability
- One machine failing does not stop the service
- Maintenance without downtime
- A whole data centre can be lost and the system survive
Scale
- Add machines rather than buying a bigger one
- Storage and write capacity grow together
- There is a limit to how large one machine can be
Locality
- Keep data near the users who read it
- A request crossing the world costs real latency
- Some laws require data to stay in a country
Features of a distributed database the guide lists
| Feature | What it means |
|---|---|
| Replication / data partitioning | Copies of data kept on several machines / data split between machines (fragmentation, above) |
| Data consistency + ACID | Every copy must agree; transactions spanning several nodes must still be atomic, consistent, isolated and durable |
| Concurrency control | Locks or timestamps stop two users on different nodes changing the same data at once |
| Distribution transparency | Users and programs see one database, not many machines |
| Location transparency | A query does not need to say where the data is stored |
| Global query processing | One query is split, run on the nodes that hold the data, and the results combined |
| Fault tolerance | The system keeps working when a node fails, using other copies |
| Scalability | Capacity grows by adding nodes |
| Data security | Data travelling between sites is encrypted and every node enforces the same access rights |
Memorize terms 3x faster
Smart flashcards show you cards right before you forget them. Perfect for definitions and key concepts.
Consistency against availability: When machines cannot reach each other, the system must choose between staying consistent and staying available.
Stay consistent
- Refuse to answer rather than risk returning stale data
Stay available
- Answer from whatever copy is reachable
- Accept that it may be out of date
A business decision: You cannot have both during a network partition, and which one you choose is a business decision.
The other costs
- Complexity — far harder to design, operate and reason about
- A query spanning shards may need a join across the network, which is slow
- Eventual consistency means a read straight after a write can return the old value
- Debugging is harder: the fault may be in the network, not in any machine
- Transactions across machines are difficult and often not offered at all
Banking balance — consistent
- Better to refuse than to allow two withdrawals of the same money
Social media feed — available
- A post arriving a few seconds late is nobody's disaster
Pick the right side for the scenario: An answer naming which matters here is the one that scores.
How this is tested — you must distinguish replication from fragmentation, and choose a side of the consistency trade-off from the scenario. It comes up two ways:
Paper 1 Section A
- Describe the features of distributed databases, 3-4 marks
- Define replication or fragmentation
- State one advantage of distribution
Paper 1 Section B — case study
- Justify distribution for a scenario
- Explain the consistency–availability trade-off
The classic trap: Listing advantages without the cost. Distribution forces a choice between consistency and availability during a partition, and the answer must say which this scenario needs and why.
A global messaging service stores billions of messages and must stay usable when a data centre fails. Describe how a distributed database would be used, and the trade-off it forces.
Model answer plan
See the answer broken into clear points, with guidance on how each point earns marks.