Distributed databases need data partitioning, replication, and fault tolerance to store data across networked nodes while maintaining scalability, availability, and reliability. Each feature solves a distinct problem, but they work together.
The Reasoning and Mechanism
A distributed database is a logically unified database whose data is physically stored across multiple computers or locations. Its database management system coordinates the nodes so users access them as one database.
| Feature | Mechanism and purpose | Example |
|---|---|---|
| Data partitioning | Divides data into partitions or shards. Horizontal partitioning distributes rows; vertical partitioning distributes columns. This balances storage and processing loads. | Customer records may be partitioned by region. |
| Replication | Stores copies of the same data on multiple nodes. This improves availability and read performance, but updates must be synchronized to maintain consistency. | A customer record may be copied to servers in Europe and Asia. |
| Fault tolerance | Allows the system to continue when a node or connection fails. It uses failure detection, replicated data, automatic failover, and recovery procedures. | If one server fails, another replica answers the query. |
Partitioning supports scalability because new nodes can store and process additional partitions. However, queries spanning several partitions require network communication and coordination, increasing latency.
Replication supports availability because another copy can be used after failure. Immediate replica coordination provides stronger consistency, while delayed synchronization can improve performance but temporarily return outdated data.
A common misconception is that partitioning and replication are the same. Partitioning places different subsets on different nodes; replication places copies of the same data on multiple nodes. Fault tolerance is the ability to continue despite failures, supported especially by replication.
Exam Technique
In an IB Computer Science A3.4 response, define each feature, explain its mechanism, and link it to a benefit and trade-off. Distinguish partitioning from replication, then explain how replication enables fault tolerance.