Post Graduate Program in Data science
Distributed Database
•
Post Graduate
Foundations of Distributed Databases
Introduction
A database is distributed when logically related data is stored and managed by multiple networked computing sites rather than by one central computer. The sites may be located in the same data centre, across regions, or across countries. To users and applications, the collection may appear to be one database, even though its data, processing, control, and failure risks are distributed.
Distributed databases are a response to the realities of contemporary information systems. Organisations operate across geographic boundaries, generate data continuously, serve users globally, and require availability even when individual machines or network links fail. A banking institution may maintain customer records in several regions; an online retailer may distribute product, order, and inventory data across continents; and a logistics company may collect information from thousands of vehicles and warehouses.
The central challenge is not merely placing data on several machines. It is coordinating those machines while preserving useful properties such as correctness, availability, acceptable performance, security, and manageable administration. Distribution introduces opportunities—parallel processing, local autonomy, scalability, and resilience—but also creates difficult problems involving communication delay, partial failure, replicated data, concurrency, consistency, and heterogeneous technologies.
This chapter establishes the conceptual foundation needed for later study of distributed database architecture, fragmentation, replication, distributed query processing, distributed transactions, consistency models, and modern cloud data platforms.
Learning Objectives
After studying this chapter, you should be able to:
Define a distributed database and distinguish it from a distributed database management system.
Explain the principal motivations for distributing data.
Describe transparency, autonomy, scalability, and heterogeneity as design properties.
Compare distributed databases with centralized databases, parallel databases, and distributed file systems.
Identify the consequences of network communication, replication, and partial failure.
Evaluate the trade-offs involved in selecting a distributed data architecture.
Apply foundational concepts to an organisational case.
1. From Centralized Data Management to Distributed Data Systems
In a centralized database, data management is concentrated in one logical computing environment. A database server may contain the storage, query processor, transaction manager, and recovery mechanisms. Client applications communicate with that server, often through a local or wide-area network. Centralization simplifies administration and coordination, but it can create a bottleneck, a single point of failure, and a geographic mismatch between data and users.
A distributed database separates the physical location of data and processing while preserving, as far as practical, a unified data service. The database may be partitioned into fragments, copied to multiple sites, or both. A distributed database management system (DDBMS) provides software that coordinates these sites and offers mechanisms for query processing, transaction management, recovery, security, and metadata management.
The distinction between a distributed database and a DDBMS is important:
Concept
Meaning
Distributed database
The logically related data stored across multiple networked sites
Distributed database management system
Software that manages distributed data and coordinates participating sites
Site or node
A computer or execution location participating in the system
Distributed data system
A broader term including databases, caches, streams, files, services, and coordination components
Distribution may be explicit or hidden. In an explicit design, an application knows that customer data is stored in Europe and order data in Asia. In a transparent design, the application submits a logical query and the system determines where data is located and how to access it.
A distributed database should not be confused with a collection of unrelated databases. The sites must have some degree of logical integration. They may share a schema, coordinated constraints, common transaction semantics, or a federated query layer. Independent databases connected only by occasional data exchange form a distributed information environment, but not necessarily a single distributed database.
2. A Conceptual Architecture
A distributed database can be understood through several layers:
User and application layer: business applications, analysts, services, and administrators issue requests.
Global data model: presents an integrated logical view of entities, relationships, and operations.
Distribution layer: maintains knowledge of fragments, replicas, locations, and access paths.
Coordination layer: manages distributed queries, transactions, locks or versions, replication, and recovery.
Local database layers: each site stores and processes its local data using a database engine.
Infrastructure layer: networks, operating systems, storage devices, identity services, and monitoring systems support execution.
Conceptual architecture of a distributed database
Figure: Conceptual architecture of a distributed database
Figure: A conceptual layered architecture for a distributed database.
The architecture is conceptual rather than prescriptive. Some systems use a central coordinator, whereas others use peer-to-peer coordination. Some expose a single relational schema; others combine relational, document, graph, and key-value models. The essential feature is coordinated management of logically related data across sites.
3. Why Distribute Data?
3.1 Geographic locality
Data is often generated and consumed near particular locations. Keeping data close to users can reduce network traffic and response time. A hospital may keep operational records within a regional facility, while a retailer may maintain regional inventory near distribution centres. Locality can also support legal requirements concerning data residency.
3.2 Availability and resilience
If every request depends on one server, failure of that server can interrupt the entire service. Distribution allows service to continue when a site fails, provided that required data and coordination services remain available elsewhere. Replication can support this goal, although it introduces consistency and update-coordination costs.
Distribution does not eliminate failure; it changes failure from a single visible event into a set of difficult partial-failure scenarios. One site may be unavailable while others continue operating. A network partition may prevent sites from determining whether another site has failed or is merely unreachable.
3.3 Scalability
A system may grow in data volume, request rate, number of users, or geographic coverage. A distributed architecture can add storage and processing capacity by adding sites or expanding clusters. This is commonly called horizontal scaling. However, scalability is not automatic. Central metadata services, coordination protocols, hot partitions, and cross-site transactions can become bottlenecks.
3.4 Performance and parallelism
Independent parts of a query or workload may execute concurrently at different sites. For example, regional sales data can be scanned in parallel and then combined. Performance depends on more than processor count. Network transfer, data skew, synchronization, disk access, and final-result aggregation may dominate execution time.
3.5 Organisational autonomy
Departments, subsidiaries, or partner organisations may need control over their own data and operations. A distributed architecture can permit local administration, local policies, and independent evolution while providing selected global services. Autonomy is particularly relevant in federated systems and mergers involving previously independent databases.
3.6 Cost and incremental growth
Commodity servers and cloud resources can be added progressively. An organisation may begin with one site and later distribute data as demand or geographic requirements increase. Cost advantages must be assessed holistically: network bandwidth, replication, monitoring, support, security, and operational expertise may offset savings in hardware.
4. Essential Terminology and Data Placement
Fragmentation
Fragmentation divides a relation or dataset into logically meaningful pieces. Horizontal fragmentation divides rows, such as storing European customers at one site and Asian customers at another. Vertical fragmentation divides columns, such as separating frequently accessed public attributes from sensitive attributes. A mixed strategy combines both.
A correct fragmentation scheme should normally support three properties:
Completeness: every required data item appears in at least one fragment.
Reconstruction: the original logical relation can be recreated when appropriate.
Disjointness: fragments do not unnecessarily duplicate the same item, except where controlled replication is intended.
These properties are design goals rather than universal rules. Replicated fragments intentionally violate strict disjointness, and privacy requirements may make complete reconstruction undesirable for some users.
Replication
Replication stores multiple copies of data. A full replica copies an entire dataset, while a partial replica copies selected fragments or attributes. Replicas improve read availability and locality but make updates more complex. The system must determine when an update is considered complete, how conflicting updates are resolved, and what version a reader may observe.
Partitioning and sharding
Partitioning is the division of data among nodes. In many modern systems, sharding refers to horizontal partitioning across servers, often using a partition key. Good partition keys distribute load evenly and preserve locality for common queries. Poor keys create hot spots, where one node receives disproportionate traffic.
Coordinator, participant, and metadata
A coordinator plans or supervises a distributed operation. Participants execute portions of it. Metadata describes the locations, schemas, versions, ownership, replicas, and health of distributed data. Metadata is itself critical data: if it is stale or unavailable, correct routing and coordination may be impossible.
Distributed transaction
A transaction is distributed when it accesses or updates data at more than one site. The system must coordinate commit, isolation, and recovery across participants. Protocols such as two-phase commit can provide atomic commitment under specified assumptions, but they introduce coordination overhead and can block in certain failure conditions.
5. Transparency and Its Limits
Transparency means hiding selected aspects of distribution from users or applications. It is a design objective, not a promise that distribution has no consequences.
Important forms include:
Location transparency: users need not know where data is stored.
Naming transparency: the same logical name identifies data independently of its physical site.
Fragmentation transparency: users need not know that a relation is divided into fragments.
Replication transparency: users need not select a particular copy.
Concurrency transparency: users see a controlled result despite concurrent operations.
Failure transparency: the system masks some site or communication failures.
Performance transparency: the system attempts to optimise execution without requiring application changes.
Migration transparency: data can move without changing logical references.
Transparency reduces application complexity and supports physical data independence. Nevertheless, complete transparency is rarely attainable. Network latency affects response time; consistency choices affect what data a user sees; failures may cause retries or errors; and cross-region operations may incur financial or regulatory costs. A sound design exposes the consequences that users must understand rather than concealing them behind misleading abstractions.
6. Autonomy, Heterogeneity, and Integration
Autonomy
Autonomy describes the degree to which a site controls its own data, software, policies, and operations. It has several dimensions:
Design autonomy: a site chooses its schema or data model.
Communication autonomy: a site decides whether and when to respond to external requests.
Execution autonomy: a site controls local transaction scheduling and resource use.
Administrative autonomy: a site manages users, security, backup, and operational policies.
High autonomy supports local independence but makes global consistency and integrated query processing more difficult. Low autonomy simplifies coordination but may be unacceptable to independent organisations.
Heterogeneity
Heterogeneity occurs when sites differ in hardware, operating systems, database engines, data models, query languages, schemas, or semantic conventions. Syntactic heterogeneity may involve different data types or query languages. Semantic heterogeneity is more serious: two systems may use the term “customer” to mean different populations, or record dates in different business interpretations.
Integration mechanisms include schema mapping, adapters, wrappers, extract-transform-load pipelines, data virtualization, and common APIs. These mechanisms reduce visible differences but do not remove the need for governance. A mapping can translate names and types; it cannot automatically resolve contradictory business meanings.
7. Distributed Databases Compared with Related Systems
Centralized databases
A centralized database generally has one primary execution and storage environment. It benefits from simpler transaction management, consistent metadata, and fewer communication failures. Its limitations include possible bottlenecks, geographic latency, and a larger impact from server or site failure.
A distributed database offers locality, scale-out, and resilience, but requires coordination across sites. Neither architecture is universally superior. The choice depends on workload, regulatory constraints, availability objectives, data relationships, and organisational capability.
Parallel databases
A parallel database uses multiple processors, disks, or nodes to execute database operations concurrently. Its principal objective is often performance or capacity through parallel execution. It may be physically distributed but is typically managed as a tightly integrated system under one administrative authority and one coherent database engine.
A distributed database emphasises distribution across sites, networks, and possibly autonomous organisations. The categories overlap: a distributed database can use parallel processing, and a parallel database can span multiple locations. The distinction is therefore one of emphasis, control, and failure model rather than a rigid hardware classification.
Dimension
Centralized database
Parallel database
Distributed database
Main emphasis
Unified management
Concurrent execution
Data and control across sites
Network role
Often limited to clients
Usually high-speed internal interconnect
Potentially wide-area and failure-prone
Administrative control
Usually one environment
Usually one organisation
One or several authorities
Typical challenge
Bottleneck or single-site failure
Synchronising parallel work
Partial failure and consistency
Common strength
Simplicity
High throughput
Locality, resilience, and scale-out
Distributed file systems
A distributed file system provides file and directory abstractions over multiple machines. It focuses on storing, retrieving, and sometimes replicating byte streams or files. A distributed database adds structured data semantics, schemas, indexes, query processing, transactions, constraints, and database-specific recovery.
The distinction is not absolute. Modern data platforms combine distributed file storage with query engines, catalogs, table formats, and transaction layers. Nevertheless, storing database files on a distributed file system does not by itself make the database a distributed database. The database engine must coordinate logical data operations across sites or partitions.
8. Fundamental Distributed-Systems Constraints
Network communication
Local memory and disk access are generally different from communication across a network. Messages incur transmission delay, processing delay, queueing, and sometimes retransmission. A distributed query that moves a large intermediate result may be slower than a locally executed query even if remote processors are idle.
Partial failure
In a centralized system, a failed server may be easier to identify. In a distributed system, one component can fail while others continue. A timeout does not prove that a remote operation did not execute; the response may have been lost after the operation committed. Consequently, retry logic must be designed with idempotence, request identifiers, or transactional safeguards.
Consistency and availability trade-offs
Replicated systems must define what reads may observe and when writes become visible. Strong consistency provides a more immediate and predictable view but usually requires more coordination. Weaker or eventual consistency can improve availability and latency, but applications must tolerate temporary disagreement among replicas.
The well-known CAP perspective states that, during a network partition, a system cannot simultaneously guarantee both unrestricted availability and strong consistency for all operations. This is not a general claim that only two of three desirable properties can ever exist. It concerns distributed systems under partition, and it depends on precise definitions of consistency and availability. Designers therefore specify which operations may reject requests, return stale data, or proceed under conflict-resolution rules.
Time and ordering
Clocks on different machines may disagree. Consequently, physical timestamps alone cannot always establish the order of events. Systems may use logical clocks, version vectors, sequencers, or consensus protocols, depending on their requirements. Time-related assumptions should be explicit in transaction and conflict-resolution designs.
9. Performance and Scalability Reasoning
Distributed performance should be analysed using workload and communication characteristics rather than node count alone. Important measures include latency, throughput, availability, storage capacity, replication overhead, and recovery time.
For a query divided into independent stages, the elapsed time is often constrained by the slowest stage and by communication and coordination. A simplified model is:
Ttotal ≈ Tlocal + Tnetwork + Tcoordination
Here, Tlocal is local computation and storage time, Tnetwork is time spent transmitting and receiving data, and Tcoordination is time spent synchronising sites or committing distributed work. This is a conceptual decomposition, not a universal performance law; components may overlap, and parallel execution may reduce elapsed local work.
A useful design principle is to move computation toward data when possible. Filtering and aggregation at each site can reduce the amount of data transferred. However, local processing must preserve query semantics, and premature aggregation may be invalid when global ordering, joins, or constraints are required.
Scalability also requires attention to data distribution. If a partition receives fraction p of all requests, its workload may become a bottleneck even when total cluster capacity is large. Balanced partitioning, adaptive repartitioning, caching, and workload-aware replication are common responses.
10. An Illustrative Case: GlobalCare Health Network
Background
GlobalCare is an illustrative multinational healthcare network operating hospitals in three regions. Each hospital records appointments, clinical observations, billing events, and pharmacy transactions. Initially, all records were stored in one national data centre.
Problem
The centralized system produced unacceptable latency for remote hospitals and became difficult to maintain during peak periods. A data-centre outage interrupted access to records. At the same time, health regulations required selected clinical data to remain within specified jurisdictions. Hospitals also needed local control over staff access and operational workflows.
Analysis
The organisation identified several distinct data characteristics. Appointment schedules and operational inventory were highly local and changed frequently. Patient identity and selected longitudinal records required controlled cross-site access. Billing data needed integration across regions but did not require every clinical detail to be copied everywhere.
A single architecture could not optimise all requirements. Full replication would improve access but increase privacy exposure, storage, update coordination, and regulatory complexity. Complete separation would protect local autonomy but make longitudinal care and financial reporting difficult.
Approach and solution
GlobalCare adopted a hybrid distributed design:
Operational schedules and inventory were horizontally partitioned by hospital region.
Selected patient identifiers were replicated through an encrypted, access-controlled service.
Detailed clinical records remained regionally stored, with audited references and authorised retrieval.
A global metadata catalog mapped logical records to permitted locations.
Cross-region reporting used controlled analytical pipelines rather than unrestricted operational joins.
Distributed updates used explicit transaction boundaries; workflows requiring strong coordination were kept narrow.
Each site retained local administrative autonomy for staff roles, backups, and routine operations.
Monitoring tracked replication lag, failed requests, data residency, access events, and recovery objectives.
Outcome
Local operations became less dependent on wide-area connectivity, and routine queries were served nearer to users. Global reporting remained available through governed data pipelines. The organisation accepted that some cross-region views were not instantaneous and documented this behaviour for clinicians and administrators.
Learning points
The case demonstrates that distribution should follow data relationships, access patterns, legal boundaries, and failure objectives. Replication is not a universal solution; it creates governance and consistency obligations. Transparency is valuable for ordinary access, but operational users must understand freshness, authorization, and failure behaviour. Finally, technical architecture and organisational governance must be designed together.
11. Governance, Security, and Ethical Considerations
Distributed databases enlarge the security boundary. Data may exist in multiple copies, backups, caches, logs, and analytical stores. Each copy requires appropriate access control, encryption, key management, retention, and deletion procedures. Replication can unintentionally move sensitive data across legal jurisdictions.
Important governance questions include:
Who owns each data domain and approves schema changes?
Which jurisdiction governs storage and processing at each site?
How are consent, purpose limitation, and data minimisation enforced?
Can a subject’s data be located and deleted across replicas and backups?
How are access events audited across independent administrators?
What happens when a local policy conflicts with a global availability objective?
Privacy-preserving techniques may include tokenisation, pseudonymisation, field-level encryption, minimised replication, confidential computing, and controlled query interfaces. These techniques reduce risk but do not replace data classification, lawful processing, accountability, and human oversight.
In high-impact domains such as healthcare, finance, employment, and public services, distributed design should also address fairness and explainability. A system that silently serves stale or incomplete data can produce unequal outcomes. Operational documentation should state data freshness, failure modes, and escalation procedures.
12. Contemporary Directions and Best Practices
Modern distributed databases increasingly support cloud regions, elastic clusters, serverless execution, streaming data, multi-model storage, and globally replicated services. Some systems provide strong transactional guarantees across regions; others prioritise low latency and reconcile conflicting updates. Newer architectures also separate compute from storage and use shared-nothing clusters, object storage, or specialized analytical engines.
Artificial intelligence is relevant mainly as an application and operational aid rather than as a replacement for database fundamentals. Machine-learning workloads may require distributed feature stores, vector indexes, and large-scale training data. AI can assist workload forecasting, anomaly detection, query optimization, and capacity planning, but automated decisions must be monitored for data leakage, bias, and unsafe changes.
Sound practice includes:
begin with data ownership, access patterns, and failure objectives;
choose partition keys that align with common operations and distribute load;
minimise cross-site transactions and large data transfers;
make retries safe through idempotent operations and request identifiers;
define consistency and freshness guarantees in user-facing terms;
treat metadata and configuration as critical, replicated assets;
test partitions, clock skew, lag, corruption, and recovery—not only normal operation;
monitor cost, latency, throughput, replication lag, and error rates by site;
document data lineage, residency, retention, and deletion behaviour;
prefer the simplest architecture that satisfies the actual requirements.
Chapter Summary
A distributed database stores and manages logically related data across multiple networked sites. Its value arises from locality, resilience, scalability, parallelism, organisational autonomy, and incremental growth. Its costs arise from network communication, partial failure, coordination, replication, consistency management, heterogeneity, and operational complexity.
Key design concepts include fragmentation, partitioning, replication, metadata, distributed transactions, transparency, autonomy, and heterogeneity. Transparency can hide location and replication details, but it cannot remove the real effects of latency, failure, consistency choices, and regulatory constraints. Autonomy supports local control, while heterogeneity requires technical and semantic integration.
Distributed databases overlap with parallel databases but emphasise distribution and failure across sites. They differ from distributed file systems because they provide structured data semantics, query processing, constraints, transactions, and recovery. Effective design aligns data placement with workload, governance, legal boundaries, and failure objectives. The most successful systems combine technical coordination with explicit organisational responsibility.
Key Terms
Distributed database: A logically integrated database whose data is stored across multiple networked sites.
DDBMS: Software that manages distributed data, queries, transactions, replication, and recovery.
Site: A computer or execution location participating in a distributed system.
Fragmentation: Division of a logical dataset into smaller data units.
Horizontal fragmentation: Division of data by rows or records.
Vertical fragmentation: Division of data by columns or attributes.
Replication: Storage of multiple copies of data.
Partitioning: Distribution of data units across nodes or sites.
Sharding: Horizontal partitioning, commonly by a partition key.
Metadata: Information describing schemas, locations, replicas, versions, and ownership.
Transparency: Hiding selected physical distribution details from users.
Location transparency: Accessing data without specifying its physical site.
Autonomy: The degree of local control over data, execution, and administration.
Heterogeneity: Differences among sites in technology, schemas, models, or meaning.
Distributed transaction: A transaction involving multiple sites.
Partial failure: Failure of one component while other components continue operating.
Consistency: The rules governing what values and versions reads may observe.
Distributed file system: A system providing file storage and access across networked machines.
Parallel database: A database system using concurrent processing to improve performance or capacity.
Partition key: An attribute or rule used to assign records to partitions.
Review Questions
Short Answer Questions
What is the difference between a distributed database and a DDBMS?
Define horizontal fragmentation and give one example.
What is meant by location transparency?
Why does replication create an update-coordination problem?
What is a partial failure?
Long Answer Questions
Explain the principal motivations for adopting a distributed database and discuss the costs associated with each motivation.
Compare centralized, parallel, and distributed databases in terms of architecture, control, performance, and failure behaviour.
Discuss the forms of transparency offered by distributed database systems and explain why complete transparency is not always possible.
Explain autonomy and heterogeneity, including their effects on schema integration and global transaction management.
Describe how network communication, replication, and partial failure influence distributed database design.
Analytical / Application Questions
A retailer has regional warehouses, global customers, and strict data-residency rules. Propose a fragmentation and replication strategy, and justify the consistency guarantees for inventory, customer identity, and analytics.
A distributed query is slow even though each participating node has substantial unused processor capacity. Analyse at least four possible causes and recommend measurements or design changes.
Evaluate whether GlobalCare should replace its hybrid architecture with full replication. Consider availability, privacy, consistency, autonomy, network cost, and regulatory compliance.
Multiple Choice Questions with Answers
Question 1
Which characteristic most directly distinguishes a distributed database from a collection of unrelated databases?
A. All data must be stored on one server
B. The data is logically integrated and coordinated across sites
C. Every site must use a different database engine
D. Users must manually select the storage site
Correct Answer: B. The data is logically integrated and coordinated across sites
Question 2
What does location transparency mean?
A. Users can access data without specifying its physical site
B. All data is stored in one geographic location
C. A site can operate without a network
D. Data locations are visible in every application query
Correct Answer: A. Users can access data without specifying its physical site
Question 3
Which technique divides a relation by rows?
A. Vertical fragmentation
B. Encryption
C. Horizontal fragmentation
D. Schema mapping
Correct Answer: C. Horizontal fragmentation
Question 4
What is a principal benefit of replication?
A. It eliminates all consistency problems
B. It can improve read availability and locality
C. It prevents all network failures
D. It removes the need for metadata
Correct Answer: B. It can improve read availability and locality
Question 5
Which issue is especially associated with partial failure?
A. A remote operation may have committed even though its response was lost
B. A database cannot contain indexes
C. All queries become sequential
D. Local storage becomes impossible
Correct Answer: A. A remote operation may have committed even though its response was lost
Question 6
How does a distributed file system primarily differ from a distributed database?
A. It cannot use multiple machines
B. It focuses on files rather than database semantics such as queries and transactions
C. It always provides stronger consistency
D. It requires every file to be stored centrally
Correct Answer: B. It focuses on files rather than database semantics such as queries and transactions
Question 7
Which property describes a site's control over its own schema, policies, and operations?
A. Autonomy
B. Fragmentation
C. Latency
D. Reconstruction
Correct Answer: A. Autonomy
Question 8
In the simplified performance model Ttotal ≈ Tlocal + Tnetwork + Tcoordination, what does Tnetwork represent?
A. Only CPU time at the coordinator
B. Time spent transmitting and receiving data
C. Time required to define a schema
D. Time spent encrypting every database column
Correct Answer: B. Time spent transmitting and receiving data
Question 9
Why can a poor partition key reduce scalability?
A. It can concentrate requests on a hot partition
B. It guarantees perfect load balance
C. It prevents any data from being queried
D. It removes all replicas
Correct Answer: A. It can concentrate requests on a hot partition
Question 10
According to the CAP perspective, what trade-off is relevant during a network partition?
A. A system cannot guarantee both unrestricted availability and strong consistency for all operations
B. A system cannot store both text and numbers
C. A system must choose between indexes and transactions
D. A system cannot use encryption and replication together
Correct Answer: A. A system cannot guarantee both unrestricted availability and strong consistency for all operations