Distributed Database

Chapter 2
Distributed Database Architectures and Models

Post Graduate Program in Data science
Distributed Database   •   Post Graduate

Distributed Database Architectures and Models

Introduction

A distributed database is a logically unified collection of data whose physical components are stored, processed, or managed across multiple networked computers. Distribution may be introduced to improve availability, reduce latency, increase capacity, support geographic operations, or isolate workloads. It also creates additional responsibilities: a distributed database must coordinate transactions, manage replicas, tolerate partial failures, preserve security boundaries, and provide users with a coherent data model.

Architecture describes how computation, memory, storage, and control are physically organized. A model describes how participating systems cooperate and how data ownership, query processing, and administration are represented. These concepts should be distinguished. For example, a shared-nothing cluster is an architecture, whereas a federated database is primarily an integration and governance model. A cloud data warehouse may use shared-nothing execution internally while presenting separation of storage and compute to its users.

The central design question is not whether one architecture is universally superior. It is whether the architecture’s failure behavior, performance characteristics, governance model, and operating costs fit the workload.

Learning Objectives

After studying this chapter, you should be able to:

  1. Explain the architectural dimensions of distributed databases.
  2. Compare shared-memory, shared-disk, and shared-nothing systems.
  3. Analyze client-server, peer-to-peer, cluster, federated, multidatabase, edge, and cloud models.
  4. Distinguish data, compute, and storage separation.
  5. Evaluate architectures using consistency, availability, scalability, latency, fault tolerance, and governance criteria.
  6. Recommend an appropriate architecture for a realistic organizational scenario.

1. Architectural Foundations

1.1 Distribution dimensions

A system can be distributed along several independent dimensions:

  • Data distribution: tables, partitions, documents, or files are placed at different sites.
  • Compute distribution: query operators or application services execute on multiple machines.
  • Storage distribution: durable data is spread across disks, nodes, availability zones, or regions.
  • Control distribution: metadata, transaction coordination, membership, and leadership are managed by one or several authorities.
  • Administrative distribution: different organizations or departments retain control over their databases.
  • Geographic distribution: resources are separated by distance, often producing significant and variable network latency.

A system may distribute only storage, only query execution, or all of these dimensions. Consequently, the phrase “distributed database” covers a broad family of designs.

1.2 Transparency and autonomy

A distributed DBMS attempts to provide distribution transparency: users should be able to query logical data without manually locating every fragment or replica. Important forms include:

  • Location transparency: the user need not know where data resides.
  • Fragmentation transparency: the user need not know that a relation is partitioned.
  • Replication transparency: the system hides the existence of multiple copies.
  • Failure transparency: the system masks some node or network failures.
  • Performance transparency: the system tries to optimize execution despite distribution.

Transparency is a goal, not an unlimited guarantee. Hiding distribution can make diagnosis, cost estimation, and governance more difficult. Autonomy refers to the degree to which a site controls its own schema, transactions, availability policy, and evolution. High autonomy supports organizational independence but makes global optimization and consistency harder.

1.3 Network and failure assumptions

In a centralized database, a process failure and a storage failure are often relatively easy to localize. In a distributed database, communication itself may fail. A node may be alive but unreachable; two nodes may hold different views of membership; or messages may arrive late or out of order. These are partial failures.

Distributed designs therefore specify:

  • whether communication is synchronous or asynchronous;
  • how nodes discover membership;
  • how leaders are elected;
  • how replicas acknowledge writes;
  • what happens during network partitions;
  • whether stale reads are permitted; and
  • how recovery and reconciliation occur.

A system cannot simultaneously guarantee every desirable property under every failure condition. In particular, during a network partition, a design generally must choose between rejecting some operations to preserve a single consistent view and accepting operations that may temporarily diverge. This is the practical significance of consistency–availability trade-offs in distributed systems.

2. Shared-Resource Architectures

2.1 Shared-memory architecture

In a shared-memory system, multiple processing units access a common main memory and commonly a common operating-system environment. A database may use parallel worker threads that share buffer pools, locks, and metadata.

Strengths include low-latency communication, relatively simple coordination, and efficient sharing of cached pages. Shared-memory parallelism is especially effective for tightly coupled operations and moderate-scale database servers.

Limitations include contention for memory bandwidth, finite expansion capacity, and a large failure domain. If the operating system or machine fails, many services may become unavailable. Although large symmetric multiprocessor systems exist, scaling them economically can be difficult.

2.2 Shared-disk architecture

In a shared-disk system, several compute nodes have independent memory and CPUs but access a common storage subsystem. Each node can potentially access the whole database. A cluster-wide lock manager or cache-coherence mechanism coordinates concurrent access.

Shared-disk designs simplify data placement because any node can process any data. They support workload relocation and can provide strong availability when compute nodes fail independently. However, the storage fabric, metadata services, and global locking mechanisms can become bottlenecks. Cache coherency also generates communication traffic when several nodes modify the same pages.

Shared-disk is distinct from storage replication. A shared storage array may itself replicate data internally, while database nodes coordinate access above it.

2.3 Shared-nothing architecture

In a shared-nothing architecture, each node owns a private CPU, memory, and storage. Data is partitioned among nodes, and nodes communicate through the network. A query coordinator decomposes a request into parallel tasks, which execute close to the relevant partitions.

A common partition function assigns a row to a node using a key. For hash partitioning, a simplified placement rule is:

node(row) = h(key) mod N

Here, h(key) is a deterministic hash value, N is the number of partitions or nodes, and the result identifies a placement bucket. The rule assumes that the partition count and mapping are stable. Production systems often use consistent hashing, virtual nodes, or a metadata map so that adding a node does not move every row.

Shared-nothing systems scale by adding nodes and are naturally resilient to failure of an individual worker when data is replicated. They reduce resource contention and are well suited to large analytical workloads. Their principal difficulties are data skew, network-intensive joins, repartitioning, distributed transactions, and rebalancing.

Data skew occurs when a partition receives disproportionately large data or workload. A hash key with many identical values, such as a popular customer or tenant identifier, can create a hot partition. Range partitioning can make range queries efficient but may produce hot spots when new records concentrate at one end.

2.4 Comparison

ArchitectureResource relationshipMain advantagePrincipal limitation
Shared-memoryCPUs share memory and usually storageFast coordinationScaling and failure domain
Shared-diskNodes share storageFlexible access to all dataStorage and lock contention
Shared-nothingNodes own independent resourcesHorizontal scalabilityRepartitioning and distributed joins

3. Service and Participation Models

3.1 Client-server architecture

In the client-server model, clients submit requests and servers provide database services. The client may contain only presentation and application logic, while the server manages parsing, authorization, transactions, storage, and recovery. In a two-tier design, applications connect directly to a DBMS. In a three-tier design, an application service sits between clients and the database.

The model centralizes control and simplifies governance. Connection pooling, prepared statements, and server-side authorization can improve efficiency and security. However, a single database server or service tier can become a bottleneck or failure point. Replication, load balancing, and partitioning are commonly added to remove these limitations.

3.2 Peer-to-peer architecture

In a peer-to-peer database, nodes have broadly similar responsibilities. Any node may accept requests, store data, participate in replication, and communicate with other nodes. This avoids a permanently centralized coordinator and can support geographic distribution.

Peer-to-peer systems require robust membership, failure detection, conflict resolution, and routing. Some use leaderless replication, while others elect temporary leaders for particular partitions or operations. They are attractive for high write availability and globally distributed services, but they may expose eventual consistency, conflict resolution, and operational complexity.

3.3 Cluster architecture

A database cluster is a set of cooperating computers presented as one logical service or as a coordinated collection of services. Cluster architectures may be shared-memory, shared-disk, or shared-nothing. Therefore, “cluster” describes packaging and coordination rather than one specific resource model.

Cluster design involves:

  • membership and health monitoring;
  • leader election or coordinator selection;
  • partition placement and replica placement;
  • failover and recovery;
  • network segmentation and quorum policy; and
  • rolling upgrades.

A cluster does not automatically guarantee high availability. If all replicas share one power domain, network switch, or availability zone, a common infrastructure failure can still interrupt service.

4. Integration and Autonomy Models

4.1 Federated databases

A federated database integrates autonomous databases under a common access framework. Each participating system may retain its own schema, query processor, transaction policy, and administrator. A federation provides global views, wrappers, adapters, or mediators that translate requests into local operations.

Federation is useful after mergers, in research collaborations, and when departments must retain control of their systems. It reduces the need for immediate physical migration. The costs include semantic heterogeneity, incompatible data types, different security policies, incomplete global transactions, and uncertain performance. A federated query may be limited by the slowest or least capable source.

4.2 Multidatabase systems

A multidatabase system is a broader category in which multiple databases are accessed together, often without making them appear as one fully integrated database. It may support a common query interface while preserving local autonomy. Federated systems are often considered a more structured form of multidatabase system, although terminology varies across literature.

Important design choices include:

  • tightly coupled integration: a global schema and coordinated metadata;
  • loosely coupled integration: independent databases accessed through middleware;
  • read-only integration: global reporting without distributed updates;
  • workflow integration: local transactions coordinated through business processes rather than one atomic transaction.

When global atomicity is not feasible, an organization may use sagas: a sequence of local transactions with compensating actions. A compensation is not a technical rollback; it is a new business operation that reverses or offsets an earlier effect.

4.3 Data virtualization and logical integration

Data virtualization presents a unified access layer over heterogeneous sources without necessarily copying all data into one repository. It can reduce duplication and provide near-real-time access, but query performance depends on source systems and network conditions. For recurring analytical workloads, extraction, transformation, and loading into a governed warehouse or lakehouse may be more predictable.

5. Separation of Data, Compute, and Storage

Traditional database servers often colocate data, query processing, memory, and durable storage. Modern systems increasingly separate these resources logically or physically.

5.1 Data separation

Data separation means distributing or isolating logical data sets. Examples include horizontal partitioning by customer, vertical partitioning by columns, tenant isolation, and regional placement. Separation can improve locality and governance but may complicate joins and cross-tenant reporting.

5.2 Compute separation

Compute separation allows query or transaction workers to scale independently of durable data. Several compute clusters may read the same logical data for production transactions, analytics, or machine-learning workloads. This reduces interference between workloads, but concurrent writers and readers require carefully defined isolation and metadata protocols.

5.3 Storage separation

Storage separation places durable data in a shared or disaggregated storage layer, while compute nodes are transient or independently scalable. Object storage is a common example in analytical platforms. Benefits include elasticity, durability mechanisms, and independent capacity management. Costs include network latency, metadata overhead, caching complexity, and the need to control data-transfer charges.

5.4 A useful design distinction

Separation does not mean absence of coordination. A compute node still requires metadata describing schemas, partitions, versions, statistics, permissions, and snapshots. The more physically separated the components, the more important metadata consistency, caching, and failure recovery become.

6. Edge and Cloud Architectures

6.1 Edge databases

Edge databases place data processing near devices, users, or operational sites. Examples include retail stores, vehicles, hospitals, industrial controllers, and mobile applications. Edge placement reduces round-trip latency and allows local operation during intermittent connectivity.

Edge systems commonly use local-first or offline-first techniques. Updates are later synchronized with regional or central services. The design must address duplicate operations, clock uncertainty, conflict resolution, limited hardware, physical tampering, and data minimization. A local database should not automatically store every central record; selective replication reduces exposure and bandwidth consumption.

6.2 Cloud database architectures

Cloud databases may be managed services, self-managed virtual machines, serverless systems, distributed warehouses, or globally replicated operational stores. Cloud architecture commonly provides:

  • elastic provisioning;
  • automated backup and replication;
  • multiple availability zones;
  • policy-based access control;
  • metered resource consumption; and
  • programmable infrastructure.

Cloud elasticity can conceal architectural limits. A workload may scale compute while remaining constrained by partition hot spots, transaction coordination, storage throughput, or network egress. A sound design therefore measures bottlenecks rather than assuming that more virtual machines solve every problem.

Cloud systems also introduce provider dependency, regional outage risk, data-residency constraints, and cost unpredictability. Multi-cloud deployment may reduce dependence on one provider but increases operational and data-movement complexity.

7. Evaluating Architectures

Architecture selection should begin with workload and risk requirements rather than technology fashion. A useful evaluation considers the following dimensions.

CriterionQuestions
ConsistencyMust every reader see the latest committed value? Are bounded-stale or eventual reads acceptable?
AvailabilityMust the service continue during node, zone, or regional failure?
LatencyIs the target measured at the median, 95th percentile, or 99th percentile?
ScalabilityDoes demand grow in data volume, users, throughput, or geographic reach?
Workload shapeAre operations transactional, analytical, streaming, or mixed?
GovernanceWho owns the data, keys, metadata, and retention decisions?
RecoveryWhat recovery-point and recovery-time objectives apply?
CostAre costs driven by compute, storage, requests, replication, or data transfer?

For a replicated system, a simplified durability intuition is that independent replica failures become less likely as the number of replicas increases. However, independence is a crucial assumption. Replicas in the same failure domain may fail together, and replication does not protect against accidental deletion, corruption, or incorrect application logic. Consequently, backups, immutable snapshots, and tested restoration remain necessary.

8. Worked Design Example

Suppose an international delivery platform has 20 million active customers, requires local order submission, and conducts global analytics each night. Orders must remain available when a regional network link is interrupted. Financial settlement, however, must not create two conflicting authoritative payments.

A reasonable design is a hybrid architecture:

  1. Regional shared-nothing clusters store orders partitioned by customer or region.
  2. Each regional cluster keeps replicas across availability zones.
  3. Edge or branch services buffer operational events during temporary disconnection.
  4. A globally coordinated payment service handles authoritative settlement.
  5. Change data capture streams committed events to a cloud analytical store.
  6. Independent analytical compute reads the shared analytical storage without competing directly with order transactions.

This design separates operational and analytical compute, keeps latency-sensitive data near users, and reserves strong coordination for the payment domain. It does not promise that every global view is instantly current. Instead, the architecture explicitly identifies where strong consistency is required and where asynchronous convergence is acceptable.

9. Case Study: Illustrative University Research Federation

Background

A university consortium operates laboratories at four institutions. Each laboratory uses a different DBMS and records genomic experiments, instrument measurements, and sample metadata. Researchers need cross-institutional searches, but laboratories must retain control of sensitive data.

Problem

A central migration would be expensive and could violate local governance rules. The systems also use different identifiers, measurement units, and privacy classifications. Some laboratories can provide only delayed access.

Analysis

A single shared-nothing cluster would simplify global querying but would remove local autonomy and create a large migration project. A peer-to-peer design would not by itself solve semantic differences. A federated multidatabase model is more appropriate, provided that the consortium defines common metadata and access policies.

Approach

The consortium creates a global catalog containing approved dataset descriptions, common identifiers, unit mappings, provenance information, and data-use restrictions. Wrappers translate global queries into local queries. Sensitive records remain local; only approved attributes or aggregate results are returned. Long-running cross-site analyses use workflows rather than assuming one distributed ACID transaction. Results include source, timestamp, transformation, and quality metadata.

Outcome

Researchers gain a unified discovery interface while laboratories preserve operational autonomy. Queries involving well-mapped metadata perform effectively, whereas complex joins across poorly standardized sources are restricted or materialized into a governed research store.

Learning points

The case illustrates that integration is partly a technical problem and partly a governance problem. A federation succeeds when semantic standards, identity management, consent, provenance, and performance expectations are designed alongside adapters and query processing.

10. Challenges, Governance, and Best Practices

10.1 Common technical challenges

  • Distributed transactions: coordination adds latency and can reduce availability.
  • Replication conflicts: concurrent updates require ordering, merging, or rejection rules.
  • Hot spots: uneven keys or popular records overload particular partitions.
  • Observability: a slow query may involve many nodes and services.
  • Schema evolution: incompatible changes can break old clients and replicas.
  • Recovery: rebuilding a replica consumes network and storage resources.
  • Clock and ordering issues: physical clocks cannot be assumed perfectly synchronized.

10.2 Governance and ethical considerations

Distributed data may cross legal jurisdictions. Designers must address data residency, purpose limitation, retention, deletion, encryption, access logging, and subject rights where applicable. Replicas and backups can outlive the primary record, so deletion policies must cover every copy and derived index. Federated systems require clear responsibility for incorrect data, unauthorized disclosure, and audit failures.

Sensitive data should be minimized at the edge and encrypted in transit and at rest. Authorization should be based on authenticated identity, service role, tenant, purpose, and sometimes location. Administrative convenience is not a sufficient reason to centralize personal data.

10.3 Best practices

  1. Define consistency requirements per business operation rather than for the entire platform.
  2. Place replicas across independent failure domains.
  3. Choose partition keys using access patterns, cardinality, and expected growth.
  4. Measure tail latency, not only averages.
  5. Test node, zone, network, and regional failures regularly.
  6. Maintain backups independent of live replication.
  7. Version schemas and contracts explicitly.
  8. Record lineage, provenance, and data ownership.
  9. Automate rebalancing only with safeguards and observability.
  10. Document trade-offs so that future operators understand why the architecture was chosen.

Contemporary Developments

Modern platforms increasingly combine shared-nothing execution, disaggregated storage, object-based data lakes, streaming ingestion, and elastic cloud compute. Lakehouse architectures attempt to combine low-cost, open storage with warehouse-style transactions and governance. Serverless query engines reduce infrastructure management but make workload cost and performance dependent on scan volume, partition pruning, and concurrency controls.

Artificial intelligence is relevant in three limited but important ways. First, machine-learning workloads require distributed feature and vector data management. Second, anomaly detection can help identify replication lag, hot partitions, and unusual access patterns. Third, AI-generated queries and agents increase the importance of authorization, query validation, cost limits, and protection against data exfiltration. AI does not remove the need for explicit schemas, policies, and human accountability.

Chapter Summary

Distributed database architecture concerns the organization of data, computation, storage, and control across networked resources. Shared-memory systems provide fast tightly coupled coordination, shared-disk systems allow multiple nodes to access common storage, and shared-nothing systems achieve scalable parallelism through independent ownership of resources. Client-server systems centralize service delivery, while peer-to-peer systems distribute responsibility among comparable nodes. Clusters coordinate multiple machines for scale and resilience.

Federated and multidatabase models address integration among autonomous databases. Edge architectures move processing near users and devices, whereas cloud architectures emphasize elasticity, managed infrastructure, and service-based operation. Separating data, compute, and storage can improve scalability and workload isolation, but it increases metadata, networking, and coordination requirements.

No architecture eliminates trade-offs. Correct design requires explicit decisions about consistency, availability, latency, failure domains, governance, cost, recovery, and data ownership. The strongest professional practice is to match architecture to workload and risk, test failure behavior, and document where the system deliberately chooses strong coordination, local autonomy, or eventual convergence.

Key Terms

Distributed database: A logically unified database whose resources or data are distributed across networked systems.

Distribution transparency: The ability to hide physical distribution from users or applications.

Shared-memory: An architecture in which processors access common main memory.

Shared-disk: An architecture in which independent compute nodes access common storage.

Shared-nothing: An architecture in which nodes independently own CPU, memory, and storage resources.

Partitioning: Dividing data into separately managed portions.

Replication: Maintaining multiple copies of data.

Data skew: Uneven distribution of data or workload across partitions.

Client-server: A model in which clients request database services from servers.

Peer-to-peer: A model in which nodes have broadly equivalent responsibilities.

Cluster: A coordinated group of computers providing a logical database service.

Federated database: An integration of autonomous databases through common access mechanisms.

Multidatabase system: A system that accesses multiple databases while preserving some degree of independence.

Data virtualization: Unified access to heterogeneous sources without necessarily consolidating their data.

Edge database: A database deployed near users, devices, or operational sites.

Compute separation: Independent scaling or placement of query and transaction processing.

Storage separation: Independent management of durable storage and compute resources.

Consistency: The rules governing which values and versions users may observe.

Failure domain: A set of components likely to fail from one common cause.

Data provenance: Information describing a datum’s origin, transformations, and history.

Review Questions

Short Answer Questions

  1. What is the difference between shared-disk and shared-nothing architecture?
  2. Define location transparency and replication transparency.
  3. Why can data skew reduce the performance of a shared-nothing cluster?
  4. What is the main purpose of a federated database?
  5. State two governance challenges associated with distributed replicas.

Long Answer Questions

  1. Compare shared-memory, shared-disk, and shared-nothing architectures in terms of scalability, coordination, and failure behavior.
  2. Explain how client-server, peer-to-peer, and cluster models distribute control and responsibility.
  3. Discuss the benefits and risks of separating data, compute, and storage in a cloud platform.
  4. Explain why a federated database requires both technical adapters and semantic governance.
  5. Design an architecture for a global transaction-processing system that also supports large-scale analytics.

Analytical / Application Questions

  1. A retailer requires local operation in stores during network outages but needs centralized inventory reconciliation. Which combination of edge, cloud, replication, and conflict-resolution techniques would you recommend, and why?
  2. A shared-nothing analytical cluster has one partition receiving 40% of all requests. Diagnose likely causes and propose partitioning, routing, and workload-management remedies.
  3. Four hospitals want cross-organization research queries but cannot transfer identifiable patient records to a central database. Evaluate a federated architecture and specify the metadata, security, provenance, and query limitations required.

Multiple Choice Questions with Answers

Question 1

Which architecture gives each node private CPU, memory, and storage resources?

A. Shared-memory

B. Shared-disk

C. Shared-nothing

D. Single-server

Correct Answer: C. Shared-nothing

Question 2

In the rule node(row) = h(key) mod N, what does N represent?

A. The number of nodes or placement buckets

B. The network latency

C. The number of replicas per row

D. The transaction isolation level

Correct Answer: A. The number of nodes or placement buckets

Question 3

Which feature is most characteristic of a federated database?

A. All data must be migrated into one physical cluster

B. Participating databases retain some local autonomy

C. Every node must have identical hardware

D. Queries cannot use metadata

Correct Answer: B. Participating databases retain some local autonomy

Question 4

What is a major risk of range partitioning for continuously increasing keys?

A. It always prevents range queries

B. It can create a hot partition at the active range

C. It eliminates the need for replication

D. It requires shared memory

Correct Answer: B. It can create a hot partition at the active range

Question 5

What does compute separation primarily allow?

A. Independent scaling of processing resources and durable data

B. Removal of all metadata

C. Guaranteed zero network latency

D. Automatic semantic integration of databases

Correct Answer: A. Independent scaling of processing resources and durable data

Question 6

Which model places processing close to devices or users to reduce round-trip latency?

A. Edge database architecture

B. Shared-memory architecture

C. Centralized archival architecture

D. Single-tier batch architecture

Correct Answer: A. Edge database architecture

Question 7

Why are backups still needed when data is replicated?

A. Replication cannot protect against every deletion, corruption, or logical error

B. Replication prevents all reads

C. Backups are required only for query optimization

D. Replicas never contain durable data

Correct Answer: A. Replication cannot protect against every deletion, corruption, or logical error

Question 8

Which issue is especially important in peer-to-peer databases?

A. Conflict resolution and membership management

B. Eliminating all network communication

C. Using one permanent central administrator

D. Preventing any node from accepting writes

Correct Answer: A. Conflict resolution and membership management

Question 9

In the illustrative university case, why were workflows preferred to one global atomic transaction?

A. Local systems had autonomy and heterogeneous transaction capabilities

B. The databases had no records

C. Researchers did not need provenance

D. A global transaction always improves latency

Correct Answer: A. Local systems had autonomy and heterogeneous transaction capabilities

Question 10

Which metric focuses on unusually slow requests rather than typical requests?

A. Mean storage capacity

B. Tail latency such as the 99th percentile

C. Replica count only

D. Schema cardinality

Correct Answer: B. Tail latency such as the 99th percentile

Distributed Database
Chapter 2 of 15