C3-Distributed_Databases
C3-Distributed_Databases
Distributed
Systems
Level : 3rd year Software Engineering
Instructor : Dr. Wafa MEFTEH
2
Plan
2 - Distributed Databases
Wafa MEFTEH
5
Challenges Wafa MEFTEH
Search for the tuple within the fragments most likely to contain it
Delete and remove the corresponding attribute values across all
associated vertical fragments to ensure consistency.
We use the CC
conditions: here CC3 and
CC4 are concerned.
No CC is involved.
November
25, 2024
11
Updates Examples Wafa MEFTEH
Considering:
Client(nclient, nom, ville)
Cde(ncde, #nclient, produit, qte)
Fragmentation Schema
November
25, 2024
16
Fragmentation of Dist-Queries Wafa MEFTEH
Examples
November
25, 2024
17
Fragmentation of Dist-Queries Wafa MEFTEH
Examples
Reduction of horizontal fragmentation
Rule: eliminate access to unnecessary fragments
SELECT nom FROM Client WHERE ville = ‘Paris’;
November
25, 2024
18
Fragmentation of Dist-Queries Wafa MEFTEH
Examples
Reduction of vertical fragmentation
Rule: eliminate access to basic relations that do not have attributes useful for the result.
SELECT nclient FROM Cde;
November
25, 2024
19
Fragmentation of Dist-Queries Wafa MEFTEH
Examples
Reduction of Derived-H fragmentation
Rule: distribute joints relative to unions and apply reductions for horizontal fragmentation.
SELECT * FROM Client, Cde WHERE Client.nclient = Cde.nclient AND Ville = ‘Paris’;
November
25, 2024
20
Fragmentation of Dist-Queries Wafa MEFTEH
Example
November
25, 2024
21
Execution Plan Wafa MEFTEH
November
25, 2024
22
Execution Plan Wafa MEFTEH
algebraically
optimal
November
25, 2024
23
Execution Plan Wafa MEFTEH
Rule-based optimization
November
25, 2024
25
Execution Plan Wafa MEFTEH
Example
November
25, 2024
26
Execution Plan Wafa MEFTEH
Example
Suppose that:
November
25, 2024
27
Execution Plan Wafa MEFTEH
Example
Cost comparison of the two solutions
Solution 1:
1. Transfer Cde1 + Cde2 = 20 000 n-uplets
2. Transfer Client1 + Client2 = 4 000 n-uplets
Solution 2:
1. Transfer C1 + C2 = 200 n-uplets
2. Transfer C3 + C4 = 200 n-uplets
November
25, 2024
28
Complexity of Distributed Queries Wafa MEFTEH
In a centralized database, only the I/O and CPU factors determine the complexity
of a query.
Note that we distinguish between the total cost and the overall response time of a
query:
• Total cost: this is the sum of all the time required to complete a query. In this
cost, the execution times on the different sites, the data accesses and the
communication times between the different sites that come into play.
• Global response time: this is the execution time of a query. Because some
operations can be performed in parallel at multiple sites, the overall
response time is generally less than the total cost.
November
25, 2024
30
Data Transfer Wafa MEFTEH
The transmission time of a message considers the access time and the
transmission time (data volume/ transmission rate).
The access time is negligible on a local network but can reach a few
seconds for transmissions over long distances or via satellite.
November
25, 2024
31
Thanks,