Distributed Database
Data Distribution
Relational Entities
Database Management
Information Technology

In distributed Database the data are distributed or the relational entities are distributed?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

In a distributed database system, the architecture allows for the storage of data across multiple physical locations, facilitated by multiple computers interconnected by a communication network. This setup enhances the database's availability, reliability, robustness, and scalability. The distribution of data can occur in multiple ways, either by distributing the actual data itself or by distributing the relational entities (tables) that organize the data. Understanding the distinction and the mechanics of each approach is crucial to effectively manage or leverage a distributed database system.

Key Aspects of Distributed Database Systems:

Data Distribution: This involves the placement of data across various locations. Data can be partitioned horizontally, vertically, or in a hybrid manner. Horizontal partitioning, or sharding, splits a table's rows across multiple databases or sites. Each partition contains the same columns but different rows. Conversely, vertical partitioning distributes the columns of a table to different locations, often retaining a unique identifier to maintain links between different sites.

Fragmentation and Allocation: This is closely related to data distribution but focuses on how the relational entities themselves are fragmented and allocated across different sites. Fragmentation operates in two principal modes:

  • Horizontal Fragmentation: Related rows (records) are grouped and stored in different locations. For instance, a multi-national company might store data about employees working in the USA in one server and employees in Europe in another. Each fragment maintains a similar schema but holds different subsets of the data based on specific predicates or criteria.
  • Vertical Fragmentation: Different columns of a table are stored in different locations. This might happen in cases where certain columns are accessed more frequently than others. For example, frequently accessed user profile information like usernames and email addresses might be kept separate from less frequently needed data such as historical transaction records to optimize read performance.

Replication: This technique enhances data availability by duplicating data across different sites. Replication can be done with either a passive approach, where the "master" site sends updates to "slave" sites, or an active approach, where updates can be made at multiple sites concurrently. Replication can be full or partial and aims to enhance data availability and reliability by providing redundancy.

Technical Examples:

Consider a distributed database of a library system where information is spread across multiple branches. The database might store details about books, members, loans, etc.

  • Example of Horizontal Partitioning: Books table is divided among multiple libraries based on genres. Thus, Sci-Fi books data resides in one library database, and Romance books in another.
  • Example of Vertical Partitioning: The Members table might be split so that critical information like names and membership numbers is stored in one server, while optional demographic details are in another.
  • Example of Replication: A central library database replicates its Loans table across all branch databases to allow any branch to check the status of books across the entire network.

Summary Table:

AspectDescriptionAdvantagesChallenges
Horizontal PartitioningDistributes rows across multiple databases.Localizes data, reduces query traffic.Complexity in transactions spanning multiple partitions.
Vertical PartitioningDistributes columns across databases.Efficiently handles varying access patterns.Joins and queries across sites can be complex.
ReplicationCopies data to multiple locations.Enhances data availability and reliability.Requires synchronization, increased storage needs.

Additional Considerations:

In implementing a distributed database, key challenges include dealing with data consistency, managing distributed transactions, and optimizing data access across geographically dispersed sites. Techniques such as two-phase commit and distributed query processing are integral to maintaining consistency and reliability.

Overall, whether data or relational entities are distributed, the goal remains the same: to provide a robust, fault-tolerant, and efficient system that supports varied and demanding application requirements across multiple locations.


Course illustration
Course illustration

All Rights Reserved.