Lecture: Lecture 19 - Distributed Database Management Systems
Related: DBMS Architecture and Query Processing · Distributed Transaction Classification and Two-Phase Commit · X-Open-DTP Optimizations Parallel DBMS and TPC Benchmarks

Why distribute data and computation (Slides 2–6)

A single centralized database server eventually hits limits in CPU throughput, storage capacity, network proximity, and fault tolerance. Distributed architectures spread data and computation across multiple machines, with architectural complexity depending on how independent (autonomous) the nodes are (Slide 2). Typical advantages include performance improvement, increased availability, and stronger reliability.

Architectural families (Slides 3–5, 8–14)

ArchitectureStructurePrimary goal / trade-off
Client / Server (Slides 3, 8–9)2-Tier: Thick clients (UI + some application logic) talk directly to one DBMS server.
3-Tier: Thin client (browser) ↔ Application server (business logic / web server) ↔ DBMS server.
Simplest and most widespread; centralizes data management while offloading UI/business logic.
Distributed DBMS (DDBMS) (Slides 3, 13–14)Multiple autonomous DBMS servers on different network nodes that cooperate; client transactions can span multiple servers.Geographical localization, enhanced scalability (modular), higher data availability (total block probability drops, though local blocks may happen more often). Enforcing ACID becomes far more complex.
Data replication (Slide 4)Replicas (copies) of data on another node, updated autonomously by a replication server.Simpler architecture than a full DDBMS; improves read availability/locality.
Parallel architectures (Slide 5)Multiprocessor machines or CPU clusters linked by dedicated high-speed networks.Performance increase is the only objective.
Data warehouses (Slide 5)Servers specialized for decision support (OLAP vs. OLTP).Analytical workloads rather than operational transactions.

SQL execution modes in Client/Server (Slides 10–11)

  • Compile & Go (Slide 10): Client sends query → server builds query plan → executes → ships result → discards the plan. Effective for one-shot queries and dynamic SQL.
  • Compile & Store (Slide 11): Client sends query → server builds query plan and stores it for future usage → executes and ships result. Efficient for repeated, parametric executions of the same query.

Portability vs. Interoperability (Slide 6)

  • Portability: Moving an application/program from one DBMS to another — guaranteed by the SQL standard.
  • Interoperability: Different DBMS servers cooperating on a shared task — requires interaction protocols such as ODBC and X-Open-DTP.

Data fragmentation (Slides 15–22)

In a DDBMS, a logical relation does not exist as a single physical file (Slide 22). Instead, is partitioned into fragments—subsets of in terms of rows, columns, or both—stored in separate files and possibly on separate servers, while remaining reconstructible into (Slides 16, 22).

Fragmentation TypeWhat It SelectsRelational OperatorOverlap?How to Rebuild
Horizontal (Slides 17–18)Subset of tuples (rows) with the same schema as Selection where is the partitioning predicateNo (not overlapped / disjoint)Union:
Vertical (Slides 19–20)Subset of schema (columns) containing all tuplesProjection Yes — overlapping on the Primary KeyNatural Join:
Mixed (Slide 16)Both horizontal and vertical together and combinedDisjoint rows; primary key shared across vertical splitsUnion and Join combined

Why horizontal fragments are disjoint while vertical fragments overlap

  • Horizontal fragments hold complete rows, so every tuple has all its columns and belongs to one partition; overlapping rows would duplicate tuples and waste space/create update anomalies on union.
  • Vertical fragments slice columns off the same rows. Without repeating the Primary Key in every vertical fragment, you could not reconnect the split attributes back to the same original row via a join.

Source examples (Slides 18, 20)

Given Employee(Emp#, Ename, DeptName, Tax):

  • Horizontal fragmentation on DeptName (card(DeptName) = N, Slide 18):
    • , ,
    • Reconstruction:
  • Vertical fragmentation (Slide 20):
    • Reconstruction:

Fragmentation correctness properties (Slide 21)

Every valid fragmentation must satisfy two properties:

  1. Completeness: Every piece of information in relation is contained in at least one fragment (nothing is lost).
  2. Correctness: All information in can be rebuilt exactly from its fragments.

Allocation of fragments (Slides 23–24)

The allocation schema specifies which server nodes store each fragment:

  • Non-redundant mapping (Slide 23): Each fragment is stored on one single node (e.g., fragments 1 and 3 on SITE 1, fragment 2 on SITE 2). Simpler updates, lower availability if a node fails.
  • Redundant mapping (Slide 24): Some fragments are replicated on multiple servers (e.g., fragment 3 on SITE 1 + SITE 2). Increases data availability, at the cost of complex maintenance because copy synchronization is required on updates.

Transparency levels (Slides 25–29)

Transparency levels describe how much knowledge of data distribution an application needs—the programmer writes queries differently depending on what level the DDBMS supports (Slide 25).

Source example (Slides 26–29)

Given Supplier S(S#, SName, City, Status) with horizontal fragmentation on City ({Torino, Roma}) and allocation schema:

  • stored at S1@xxx.torino.it
  • replicated at S2@xxx.roma1.it and S2@xxx.roma2.it
Level (Highest → Lowest)What the programmer knowsExample query
1. Fragmentation transparency (Slide 27)Knows only table S; fragments and servers are completely hidden.SELECT SName FROM S WHERE S# = :CODE
2. Allocation transparency (Slide 28)Knows fragments (S1, S2) and must enumerate them, but does not know physical locations or replicas.SELECT SName FROM S1 WHERE S# = :CODE
IF (NOT FOUND) SELECT SName FROM S2 WHERE S# = :CODE
3. Language transparency (Slide 29)Must select both the fragment and its exact physical node/replica (no SQL dialects used). Target format into which a DDBMS translates higher-level queries.SELECT SName FROM S1@xxx.torino.it WHERE S# = :CODE
IF (NOT FOUND) SELECT SName FROM S2@xxx.roma1.it WHERE S# = :CODE

Common confusions

  • “Language transparency” sounds high-level, but it is the LOWEST transparency level: In this course’s terminology, fragmentation transparency hides the most (you only see S), allocation transparency hides node addresses (you name S1, S2), and language transparency exposes both fragment names and server/replica addresses (S2@xxx.roma1.it), only keeping standard SQL syntax without vendor dialects.
  • Vertical fragments overlap ONLY on the primary key (or key attributes needed to join): Don’t confuse vertical overlap with horizontal fragments, which must be disjoint.
  • Portability vs. Interoperability: Portability moves one program between systems (SQL standard); interoperability lets multiple different DBMSs cooperate at runtime (ODBC, X-Open-DTP).

Retrieval questions with answers

1. Why are horizontal fragments required to be non-overlapping, whereas vertical fragments must overlap on the primary key?
Horizontal fragments contain complete rows rebuilt via Union (), so overlap would duplicate records. Vertical fragments slice columns of the same rows and are rebuilt via Natural Join (), so the primary key must appear in every fragment to reconnect the split attributes back to their original row.

2. Under redundant fragment allocation, what exact tradeoff does replicating S2 at both roma1.it and roma2.it introduce?
Replicating S2 increases data availability (and supports local reads), but makes writes and maintenance complex because the system must synchronize copies across sites.

3. Rewrite SELECT SName FROM S WHERE S# = :CODE as it would look under Allocation transparency vs. Language transparency when S is split into S1@siteA and S2@siteB.
Under Allocation transparency, the programmer queries fragments without node locations (FROM S1, falling back to FROM S2). Under Language transparency, the programmer explicitly names both the fragment and server/replica (FROM S1@siteA, falling back to FROM S2@siteB).