Title: ????? t?t?? d?af??e?a?
1????te?t?????? S?st?µ?t?? ??se?? ?ed?µ????
2 ????te?t?????? S?st?µ?t?? ??se?? ?ed?µ????
- S???e?t??t??? s?st?µata ??
- S?st?µata pe??t? - e??p??et?t? (client-server)
- ?a??????a s?st?µata ??
- ?ata?eµ?µ??a s?st?µata ??
- S?st?µata ?µ?t?µ?? ??µß?? (p2p)
3S???e?t??t??? s?st?µata
- ??te????ta? se ??a µ??? ?p?????st??? s?st?µa
?a? de? a????ep?d???? µe ???a ?p?????st???
s?st?µata - Ge????? ???s?? ?p?????st??? s?st?µa µ?a ? t?
p??? ???e? CPUs ?a? ??a? a???µ?? device
controllers p?? s??d???ta? d?aµ?s?? e??? ??????
d?a???? (bus), ? ?p???? pa???e? p??sßas? se
d?aµ???asµ??? µ??µ?. - S?st?µa e??? ???st? (p.?. p??s?p???? ?p?????st??
? sta?µ?? e??as?a?) s?????? ??e? µ?a µ??? CPU
?a? ??a ? d?? s??????? d?s????, t? ?e?t???????
s?st?µa µp??e? ?a ?p?st????e? µ??? ??a? ???st?. - S?st?µa p???ap??? ???st?? pe??ss?te??? d?s???,
µe?a??te?? µ??µ?, p???ap??? CPUs, ?a? ?e?t???????
s?st?µa p???ap??? ???st??. ???p??ete? ??a? µe????
a???µ? ???st?? ?? ?p???? e??a? s??dedeµ???? st?
s?st?µa µ?s? te?µat????. S???? ?a?e?ta? s?st?µa
e??p??et?t? (server system).
4?a??de??µa s???e?t??t???? s?st?µat??
5S?st?µata pe??t? - e??p??et?t?
- ?? s?st?µa e??p??et?t? (server) ??a??p??e?
a?t?se?? p?? pa?????ta? ap? m s?st?µata pe?at??
(clients)
- ??e??e?t?µata
- ?p?? ???p???s?
- ????p???s? a???ß?? e??p??et?t??
- ?e??ß????? ???st? p??sa?µ?sµ??? st?? a????e? t??
6S?st?µata pe??t? e??p??et?t? (s??.)
- ??e??e?t?µata t?? a?t??at?stas?? t?? mainframes
µe d??t?a sta?µ?? e??as?a? ? p??s?p????
?p?????st?? s??dedeµ???? se back-end
e??p??et?t?? - ?a??te?? ?e?t???????t?ta se s??s? µe t? ??st??
- ??e????a st?? a???es? p???? (resource allocation)
- ?a??te?a user interfaces
- ??????te?? s??t???s?
7S?st?µata pe??t? e??p??et?t? (s??.)
- ? ?e?t???????t?ta t?? ß?s?? ded?µ???? µp??e? ?a
????ste? se - Back-end d?a?e????eta? t?? d?µ?? p??sp??as?? sta
ded?µ??a, t?? a???????s? ?a? ße?t?st?p???s? t??
epe??t?se??, t?? ??e??? s???????sµ?? (concurrency
control) ?a? a???t?s?? (recovery). - Front-end ap?te?e?ta? ap? e??a?e?a ??a
d?µ??????a f??µ??, a?af???? ?a? ??af???? user
interfaces - ? d?as??des? µeta?? front-end ?a? back-end
???eta? µe t?? SQL ? µ?s? e??? p?????µµat??
efa?µ???? (API).
8S?st?µata pe??t? e??p??et?t? (s??.)
- ?? e??p??et?t?? µp????? ?a ?at??????p??????? se
d?? e?d? - ???p??et?t?? d?s??????? (transaction servers) ??
?p???? ???s?µ?p?????ta? ?????? se S?es?a?? S???,
?a? - ???p??et?t?? ded?µ???? (data servers), ?? ?p????
s?????? ???s?µ?p?????ta? se ??t??e?µe??st?af?
S???
9???p??et?t?? ??s???????
- ???µ????ta? ?a? query servers ? SQL server
systems. - 1. ?? pe??te? st?????? a?t?µata st?? e??p??et?t?,
?p?? e?te????ta? ?? d?s?????e?, ?a? ta
ap?te??sµata ep?st??f??ta? st?? pe??t?. - 2. ?a a?t?µata e?f?????ta? se SQL ?a?
µetaf????ta? st?? e??p??et?t? µ?s? e???
µ??a??sµ?? ???s?? ap?µa???sµ???? d?ad??as?a?
(remote procedure call - RPC). ?????? ???se?? RPC
µp????? ?a s??µat?s??? µ?a s???????? d?s?????a. - ?? p??t?p? Open Database Connectivity (ODBC)
e??a? ??a API, ??aµµ??? se C ap? t?? Microsoft,
??a d?as??des? se ??a? e??p??et?t?, ap?st???
a?t?µ?t?? se SQL ?a? ???? ap?te?esµ?t?? - ?? p??t?p? JDBC e??a? pa??µ??? µe t? ODBC,
??aµµ??? se Java
10???p??et?t?? ??s??????? (s??.)
- ??a? t?p???? e??p??et?t?? d?s??????? ap?te?e?ta?
ap? p???ap??? d?e??as?e? p??sßas?? ded?µ???? se
d?aµ???asµ??? µ??µ?. - ?? d?e??as?e? ?aµß????? t?? epe??t?se?? t??
???st??, se µ??f? d?s???????, t?? e?te???? ?a?
st?????? p?s? ta ap?te??sµata. - O? d?e??as?e? µp??e? ?a e??a? p?????µat????
(multithreaded), d??ad? µ?a µ??ad??? d?e??as?a
µp??e? ?a e?te??se? a??et?? epe??t?se??
ta?t?????a.
? d?aµ???asµ??? µ??µ? pe???aµß??e? d?aµ???asµ??a
ded?µ??a ??e? ?? d?e??as?e? µp????? ?a
p??spe??s??? t? d?aµ???asµ??? µ??µ? G?a ?a
e?asfa??ste? ?t? d?? d?e??as?e? de? ?????
p??sßas? sta ?d?a ded?µ??a ta?t?????a, ta
s?st?µata pe??t?-e??p??et?t? e?te???? aµ??ßa??
ap???e?sµ? (mutual exclusion) p.?. µe semaphores
?e?t???????? s?st?µat??
T?µa ?????µa cursor (d??µ?a!) ?a? ? f??t?s?
p?e??d?? µ?a t? f??? ??e? µe???? ??st??
11???p??et?t?? ??s??????? (s??.)
12???p??et?t?? ?ed?µ????
- ?etaf????ta? ded?µ??a st?? µ??a??? pe?at?? ?p??
?a? e?te?e?ta? ? epe?e??as?a t???, ?a? ?at?p??
µetaf????ta? ta ap?te??sµata p?s? st? µ??a?? t??
e??p??et?t?. - ???s?µ?p?????ta? sta t?p??? d??t?a LAN, ?p?? ?
s??des? a??µesa st?? pe??t? ?a? st?? e??p??et?t?
e??a? ?????? ta??t?ta?, ?? µ??a??? pe??t? e??a?
s?????s?µe? se d??aµ? epe?e??as?a? µe t? µ??a??
t?? e??p??et?t? ?a? ?? e??as?e? p?? p???e?ta? ?a
e?te?est??? e??a? ßa???? ?p?????st??? (compute
intensive). - T?µata p?? ?pe?s?????ta?
- ?etaf??? se??da? (page-shipping) ? st???e???
(item-shipping) - ??e?d?µata
- ?ed?µ??a st?? cache
13???p??et?t?? ?ed?µ???? (s??.)
- ?ed?µ??a st?? cache
- ?ed?µ??a µp??e? ?a ?????? cached st?? pe??t?
a??µa ?a? st? e?d??µes? t?? d?s??????? - ?pa?a?t?t?? e??a? ? ??e???? t?? ded?µ???? p??t??
???s?µ?p???????. ? ??e???? µp??e? ?a ???e? t?
st??µ? p?? ?p???e? a?t?s? ??e?d?µat?? sta
ded?µ??a a?t?
14???p??et?t?? ?ed?µ???? (s??.)
- ?etaf??? se??da? ? ?etaf??? st???e???
(d?a???t?t?ta) - ?????te?? µ???da µetaf???? ? pe??ss?te?a µ???µata
- ????e? ?a ???e? p??a???t?s? (prefetching)
st???e??? s?et???? µe a?t? ??a ta ?p??a ???eta? ?
a?t?s? - ? µetaf??? se??da? µp??e? ?a ?e????e? sa? µ?a
µ??f? p??a???t?s??
15???p??et?t?? ?ed?µ???? (s??.)
- ??e?d?µata
- ???? t?? ?a??ste??se?? t?? µ???µ?t??, s????
?p?????? ?pe?ß?????? a?t?se?? ?a? pa?????
??e?d?µ?t?? ap? t?? e??p??et?t? - ??e?d?µata se ??a p??a?a?t?µ??? st???e?? µp??e?
?a ?a?a??t????? ap? t?? e??p??et?t? ?a? ?a
ep?st?af??? e?? t? st???e?? a?t? de? ??e?
???s?µ?p????e?.
16????te?t?????? ?S??? (pe??????)
???t?s?
??????S
??????S
?????????S
?????????S
?????????S
? pe??t?? st???e? (ships) t?? e??t?s? se µ?a
p?e???. ? epe?e??as?a t?? e??t?s?? ???eta? st??
e??p???t?.
?????????S
17????te?t?????? ?S??? (pe??????)
- S??e??a??µe??? e??p??et?t??
??a e??t?s? e?te?e?ta? se p????? p?e????
e??t?s?
18?a??????a S?st?µata
- ?a pa??????a s?st?µata ?? ap?te????ta? ap? ??a
s????? p????? epe?e??ast?? ?a? p????? d?s???
d?a-s??dedeµ???? se ??a ??????? d??t??. - ??a coarse-grain pa??????? µ??a?? ap?te?e?ta? ap?
??a µ???? a???µ? ?s????? epe?e??ast?? - ??a µa???? pa??????? (massively parallel) ? fine
grain pa??????? µ??a?? ???s?µ?p??e? ?????de?
µ????te???? epe?e??ast??
19?a??????a ?a? ?ata?eµ?µ??a S?st?µata
- ?p?d?s?
- ????µ??? d?a?es?µ?t?ta
- ?ata?eµ?µ??? p??sßas? sta ded?µ??a
- ?a??????a ?ata?eµ?µ??a
- ? ?e?t??s? t?? ap?d?s?? µe pa??????e?
?e?t?????e? - ? ?a ded?µ??a e??a? se f?s??? ep?ped?
ap????e?µ??a se d??f??e? t?p??es?e? ?a? µp??e? ?a
ta d?a?e????eta? d?af??et??? S???
20?a??????a S?st?µata
- ??? ????a µ?t?a ap?d?s??
- ???µ?? e??d?? ? ????????s?? (throughput) ?
a???µ?? t?? e??as??? p?? µp????? ?a ????????????
se s???e???µ??? ??????? d??st?µa - ?????? ap????s?? (response time) ? ?????? p??
apa?te?ta? ??a ?a ?????????e? µ?a e??as?a ap? t?
st??µ? p?? ?a ?p?ß???e?
21?a?ade??µata ???t??? ??as??des??
22????te?t?????? ?a???????? S??
- ??aµ???asµ??? µ??µ? (shared memory) ??
epe?e??ast?? µ???????ta? ????? µ??µ? - ??aµ???asµ??? s?st?µa d?s??? (shared disk) ??
epe?e??ast?? µ???????ta? ????? s?st?µa d?s??? - ??p?ta d?aµ???asµ??? (shared nothing) ??
epe?e??ast?? ??? µ???????ta? ??te ????? µ??µ?
??te ????? d?s?? - ?e?a????? ?ß??d??? a???te?t????? s??d?asµ??
t?? pa?ap???
23????te?t?????? ?a???????? S?? (s??.)
24?ata?eµ?µ??a S?st?µata
- ?a ded?µ??a e??a? ap??µ??a se p????? µ??a???, p??
???µ????ta? t?p?? (sites) ? ??µß?? (nodes),
?? µ??a??? e??a? d?as??dedeµ??e? µ?s? e???
d??t??? (LAN ? WAN) - ?a ded?µ??a e??a? ????? ??a ???ste? p?? ta
p??spe?a????? ap? p????? µ??a???
25??d? ???
?µ??e?? ???e p?e??? t???e? t?? ?d?? t?p?
S??? ?te???e?? ???e p?e??? t???e? d?af??et???
S??? (d?af??et??? s?es?a?? S??? ? ?a? µ?-s?es?a??
S???) e?d??µes? ????sµ???
Gateway (p???) Wrapper
S???3
S???1
S???2
26????te?t?????? (a?a?efa?a??s?)
- ?e?t????p???µ??e?
- ?e??t?-???p???t?
- ??s???????
- ?ed?µ????
- ?a???????
- ??aµ???a??µe?? ? ??? µ??µ? ?a? d?s???
- ?ata?eµ?µ???
- ?µ??e??
- ?te???e??
27?ata?eµ?µ??e? ??se?? ?ed?µ????
28?ata?eµ?µ??a S?st?µata
Ge????? ?d??t?te?
??e?a?t?s?a t?? ?ata?eµ?µ???? ?ed?µ???? ??
???ste? de? p??pe? ?a ????????? p?? ß??s???ta? ta
ded?µ??a (ep??tas? t?? F?s???? ?a? ???????
??e?a?t?s?a?) ?t?µ???t?ta t?? ?ata?eµ?µ????
S??a??a???
29?ata?eµ?µ??e? ??
- ?µ??e?e?? ?ata?eµ?µ??e? ??
- ?? ?d?? ????sµ??? ?a? s??µa ?? se ????? t???
??µß???, ta ded?µ??a e??a? µ???asµ??a µeta?? t??
??µß??. - St???? ?a fa??eta? sa? µ?a e??a?a ??, ???ß??ta?
t?? ?ata??µ? t?? se ??µß???
30?ata?eµ?µ??e? ??
- ?te???e?e?? ?ata?eµ?µ??e? ?? ? S?st?µa ????ap???
?? (multidatabases) - ??af??et??? ????sµ??? ?a? s??µa ?? ap? ??µß? se
??µß? - St???? ? ????????s? d?af??et???? ?? p?? ?d?
?p?????? - ??????s? µeta?? t?p???? (local) ?a? ?e?????
(global) d?s??????? - ??a t?p??? d?s?????a p??spe?a??e? ded?µ??a st??
??µß? ap? t?? ?p??? p?????e. - ??a ?e???? d?s?????a e?te p??spe?a??e? ded?µ??a
se ??µß? d?af??et??? ap? a?t?? ap? t?? ?p???
p?????e e?te p??spe?a??e? ded?µ??a se p??????
??µß???.
31?ata?eµ?µ??e? ?? (s??.)
- ?a?a?t???st??? ?ata?eµ?µ???? ??
- ??aµ???as? ded?µ???? ?? ???ste? e??? ??µß??
µp????? ?a p??spe??s??? ded?µ??a p?? ß??s???ta?
se ???? ??µß? - ??t???µ?a ???e ??µß?? µp??e? ?a ??e? ??e??? sta
d??? t?? ded?µ??a. - ??e??asµ?? (redundancy) ta ?d?a ded?µ??a µp?????
?a epa?a??f???? se d?af??et????? ??µß???
(d?p??-ap????e?s?) ?ste t? s?st?µa ?a
?e?t?????se? a??µ? ?a? a? ??p???? t?p?? p?se? - ?e?????t?µa ? p??s?et? p???p????t?ta p??
apa?te?ta? ??a t?? s??t???sµ? t?? ??µß?? (??st??
a??pt???? ????sµ????, a???µ??? p??a??t?ta bugs,
ep?p???? epe?e??as?a/s??t???s? ??p.)
32T?µata
- ?p????e?s? ?ed?µ???? (?atateµa??sµ??, a?t???afa
(?µ???t?pa) - ?pe?e??as?a ???t?se??
- ?pe?e??as?a ??s???????
33?p????e?s?
- Se ??a ?ata?eµ?µ??? S??? p????? ??µß?? p??
µ???????µe ta ded?µ??a st??? ??µß??? - ?st? µ?a s??s? r. ??? ?a µp????se ?a ap????e?te?
se µ?a ?ata?eµ?µ??? ß?s? ded?µ???? - ?eµa??sµ?? (tµ?µat?p???s?) (fragmentation)
??ß??µe t? s??s? se tµ?µata ?a? ta t?p??et??µe
se d?af??et????? ??µß??? - ??t???afa (?µ???t?pa)
- ?eµa??sµ?? ?a? a?t???afa
- ??p???t?s? (allocation)
34?p????e?s? ?ed?µ????
- ?eµa??sµ?? (fragmentation)
- ??????t??? (horizontal)
- ???et??(vertical)
- ?ß??d????
35??????t???
- ??????t??? ?eµa??sµ?? (horizontal fragmentation)
- ?e ß?s? ??p??a s?????? -- p???? (s)
- S?????? ???a
- ??? pa?????µe p??? t?? a????? s??s?
36???et??
- ???et?? ?eµa??sµ?? (vertical fragmentation)
- µe ß?s? p??a p???? (p??ß??? p)
- p?? pa?????µe t?? a????? s??s?
- ????? ap??e?e? st? s?????s? tids.
TID
t1
t2
t3
t4
37?p????e?s? ?ed?µ????
- ??t???afa -- ?µ???t?p?a (Replication)
- ??a?es?µ?t?ta
- G??????te??? ?p?????sµ?? e??t?se??.
- S???????? ?a? ?s???????? ?p?????sµ??
- e??µ???s? a?t????f??.
R3
R1
??µß?? A
R1
R2
??µß?? ?
38?at?????? S?st?µat??
- ??at???s? p????f???a? ??a t?? ?ata??µ? t??
ded?µ???? st??? ??µß??? - T?µata
- ???ad??? ???µata
- ????te?t??????/??µ? ?ata?????
39?at?????? S?st?µat??
- ???µa ??a ???e a?t???af? se ???e ??µß?. ??at???s?
t?p???? a?t???µ?a? - ltlocal-name, birth-sitegt
- S???e?t??t???? ?at?????? (?a? a?t???af? t??)
ap?t???e? ?a? e??µe??se?? - ?at?????? se ???e ??µß? (t?p???? ?at??????)
?e?????fe? ???e a?t??e?µe?? (teµ????, a?t???af?)
p?? e??a? ap????e?µ??a st?? ??µß? (?at??????
?ata?????) ??at? p????f???a ??a ta a?t???afa t??
s??se?? p?? d?µ?????????a? st?? ??µß?. - ???es? s??s??, a?a??t?s? st?? ?at????? st?? ??µß?
p?? d?µ?????????e. - ? ??µß?? p?? d?µ?????????e ? s??s? de? a????e?
a??µa ?a? a? ? s??s? µeta?????e?.
40T?µata
- ?p????e?s? ?ed?µ???? (teµa??sµ??, a?t???afa
-?µ???t?pa) - ?pe?e??as?a ???t?se??
- ?pe?e??as?a ??s???????
41?pe?e??as?a ???t?se??
- ??t?? t?? ?/? ??st??? (D), t? ??st?? µet?d?s??
ded?µ???? (T) st? d??t?? - ???a?? ???d?? ap? t? ?,t? d??f???? ??µß?? µp??e?
?a epe?e??????ta? µ?a e??t?s? pa??????a
(ta?t?????a) d?af??? s???????? ??????
?p?????sµ?? ?a? ?????? ap????s?? - ?a??de??µa
- Sailors(sid, sname, rating, age)
- Reserves(sid, bid, day, rname)
- Reserves 40 bytes a?? p?e??da - µ?a se??da 100
p?e??de? 1.000 se??de? 100.000 p?e??de? - Sailors 50 bytes a?? p?e??da - µ?a se??da 80
p?e??de? 500 se??de? 40.000 p?e??de?
42?pe?e??as?a ???t?se??
SELECT AVG(S.age) FROM Sailors S WHERE S.rating gt
3 AND S.rating lt 7
- ??????t??? teµa??sµ?? ?? p?e??de? µe rating lt 5
st? Shanghai, gt 5 st?Tokyo. - ???pe? ?a ?p?????s??µe SUM(age), COUNT(age) ?a?
st??? d?? ??µß???. - ?? t? WHERE pe??e??e µ??? S.rating gt 6, ?a
a????se ? ?p?????sµ?? se ??a? µ??? ??µß?.
43?pe?e??as?a ???t?se??
?etas??µat?sµo? t?? e??t?s?? s S.rating gt ?1 and
S.rating lt ?2 (S) s S.rating gt ?1 and
S.rating lt ?2 (S1 ? S2) s S.rating gt ?1 and
S.rating lt ?2 (S1) ? s S.rating gt ?1 and
S.rating lt ?2 (S2) s S.rating gt ?1 and S.rating
lt ?2 (s S.rating lt 5 (S)) ? s S.rating gt ?1 and
S.rating lt ?2 (s S.rating gt 5 (S))
SELECT ... FROM Sailors S WHERE S.rating gt ?1
AND S.rating lt ?2
??????t??? teµa??sµ??
- ??????t??? teµa??sµ??
- ?? p?e??de? S1 µe rating lt 5 st? Shanghai, o?
p?e??de? S2 µe rating gt 5 st?Tokyo.
??t??es? st? Shanghai
???at?? ap??p???se??
??t??es? st? Tokyo
44?pe?e??as?a ???t?se??
SELECT AVG(S.age) FROM Sailors S WHERE S.rating gt
3 AND S.rating lt 7
- ???et?? teµa??sµ?? sid ?a? rating st? Shanghai,
sname and age st?Tokyo, tid ?a? st??? d??
??µß???. - ???pe? p??ta ?a ?a??-s??µat?ste? ? s??s? µe
s?????s? st? tid, ?a? µet? ?a ?p?????ste? ?
e??t?s?
45?pe?e??as?a ???t?se??
?etas??µat?sµo? t?? e??t?s?? s S.rating gt ?1 and
S.rating lt ?2 (S) s S.rating gt ?1 and
S.rating lt ?2 (S1 S2)
SELECT ... FROM Sailors S WHERE S.rating gt ?1
AND S.rating lt ?2
???et?? ?atateµa??sµ??
- ???et?? ?atateµa??sµ??
- sid ?a? rating st? Shanghai, sname and age
st?Tokyo, tid ?a? st??? d?? ??µß???.
46?pe?e??as?a ???t?se??
SELECT AVG(S.age) FROM Sailors S WHERE S.rating gt
3 AND S.rating lt 7
- ??t???afa a?t???afa t?? s??s?? Sailors ?a?
st??? d?? ??µß???. - ?p????? t?? ??µß?? µe ß?s? t? t?p??? ??st?? ?a?
t? ??st?? ??a t?? µetaf??? t?? ap?te??sµat??
Ge???? pa?at???s? S???p?????sµ?? t??? ??st???
??a t? µetaf??? t?? ap?te??sµat?? st?? ??µß? st??
?p???? ?p?ß?????e ? e??t?s?
47?pe?e??as?a ???t?se?? ?ata?eµ?µ??? S?????s?
PARIS
S
R
LONDON
500 pages
1000 pages
D ??st?? e???af??/a?????s?? se??da? ? ??st??
µetaf???? se??da?
- ?etaf??? ?ta? ??e???eta?, ?µf??e?µ???? ß?????? µe
t? s??s? S st?? e??te???? ß????? - ??st?? 500 D 500 1000 (D?) a? de ????µe
cache - ?? ??e???eta? µetaf??? ap?te??sµat?? ??st??
?etaf???? - ???e??? ap?te??sµat??
- 100.000 p?e??de? µe?????? 4050 90 bytes ?
2.273 se??de?
48?pe?e??as?a ???t?se?? ?ata?eµ?µ??? S?????s?
PARIS
S
R
LONDON
500 pages
1000 pages
- ?etaf??? ?ta? ??e???eta?, ?µf??e?µ???? ß?????? µe
t? s??s? S st?? e??te???? ß????? (s????e?a) - ?? ? e??t?s? de? e??e ?p?ß???e? st? ???d???
p??pe? ?a p??s??s??µe ?a? t? ??st?? µetaf???? t??
ap?te??sµat?? st?? ??µß? p?? a????? ?p?ß?????e ?
e??t?s? - ? ?p?????sµ?? µp??e? ep?s?? ?a ???e? st? ?a??s?
49?pe?e??as?a ???t?se?? ?ata?eµ?µ??? S?????s?
PARIS
S
R
LONDON
500 pages
1000 pages
- ?etaf??? ???? t?? s??s?? se ??a? ??µß? µetaf???
t?? R st? ???d??? - ??st?? 1000 ? 4500 D (µe ta????µ?s?/s?????e?s?
??st?? 3(5001000)D - ?? t? µ??e??? t?? ap?te??sµat?? e??a? p???
µe????, µp??e? ?a s?µf??e? ?a µetaf????µe ?a? t??
d?? s??se?? st?? ??µß? ?p?ß???? t?? e??t?s?? ?a?
?a ?p?????s??µe t? s?????s? e?e?
50?pe?e??as?a ???t?se?? ?µ?-S?????s?
PARIS
R
S
LONDON
1000 pages
500 pages
- ?d?a ?p?f??? µetaf???? ???? t?? s??s?? R st?
???d??? a??? µetaf??? µ??? t?? p?e??d?? p??
s??e?????ta? µe p?e??de? t?? S - ??? ???pe? ?a ?a????s??µe p??e? e??a? a?t?? ??
p?e??de?
51?pe?e??as?a ???t?se?? ?µ?-S?????s?
PARIS
R
S
LONDON
1000 pages
500 pages
- ??µa 1 St? ???d???, p??ß??? (project) S st??
st??e? t?? join - ?etaf??? t?? ap?te??sµat?? st? ?a??s?
- ??µa 2 St? ?a??s?, s?????s? t?? p??ß???? S µe t?
R. - ?? ap?t??esµa ???µ??eta? ???tt?s? (reduction) t??
R se s??s? µe t? S. - ?etaf??? t?? e??tt?s?? t?? s??s?? R st? ???d???
- ??µa 3 St? ???d???, s?????s? S µe t?? e??tt?s?
t?? R.
52?pe?e??as?a ???t?se??
- ?a??de??µa
- Sailors(sid, sname, rating, age)
- Reserves(sid, bid, day, rname)
- Reserves 40 bytes a?? p?e??da - µ?a se??da 100
p?e??de? 1.000 se??de? 100.000 p?e??de? - Sailors 50 bytes a?? p?e??da - µ?a se??da 80
p?e??de? 500 se??de? 40.000 p?e??de? - ?ed?? s?????s?? sid 10 bytes
- ??µa 1 500 D (s???s? S) 100 D (p??s?????
ap?t??esµa) (d?p??t?µa) - 100 T (??a t? µetaf???)
- ??µa 2 3 (100 1.000) 3.300 D (??a t??
?p?????sµ? t?? e??tt?s??) - 20 s?µµet??? t?te 200 D (µetaf???)
- ??µa 3 3 (200500) D 2.100 D
53?pe?e??as?a ???t?se?? ?µ?-S?????s?
PARIS
R
S
LONDON
1000 pages
500 pages
- ?d?a ?p?f??? µetaf???? ???? t?? s??s?? R st?
???d??? -- µe t?? ep?ß????s? t?? ?p?????sµ?? ?a?
t?? µetaf???? t?? p??ß???? t?? S ?a? t??
?p?????sµ?? t?? s?????s?? t?? p??ß???? µe t? R
???d?? ??te - ?d?a?te?a ???s?µ? ?ta? ?p???e? µ?a s??????
ep?????? st? s??s? S, ?a? ? ap??t?s? p??pe? ?a
d??e? st? ???d???
54?pe?e??as?a ???t?se??
- S??e??? Bloom
- (??µa 1) ??t? t?? p??ß????, st?????µe ??a d?ad???
d????sµa µe?????? k - ?ata?e?µat????µe ???e p?e??da t?? s??s?? S se
??a? a???µ? 0 ??? k-1 - (??µa 2) O ?p?????sµ?? t?? e??tt?s?? ???s?µ?p??e?
t? d????sµa - ???e p?e??da t?? R ???s?µ?p????ta? t?? ?d?a
s????t?s? ?ata?e?µat?sµ??
55 ????te?t?????? S?st?µ?t?? ??se?? ?ed?µ????
- S???e?t??t??? s?st?µata ??
- S?st?µata pe??t? - e??p??et?t? (client-server)
- ?a??????a s?st?µata ??
- ?ata?eµ?µ??a s?st?µata ??
- S?st?µata ?µ?t?µ?? ??µß?? (p2p)
56T?µata
?ata?eµ?µ??a S?st?µata
- ?p????e?s? ?ed?µ???? (teµa??sµ??, a?t???afa
-?µ???t?pa) - ?pe?e??as?a ???t?se??
- e?t??es? ?ata?eµ?µ???? s?????s??
- ?pe?e??as?a ??s???????
57?a??de??µa
?s??s? 21.8 (a) (ß)
?(Eid, Did, Sal) 100.000 se??de? D(Did, Mgrid,
Budget) 5.000 se??de? ???e??? p?e??da? 20 bytes,
sal, budget ?µ???µ??fa ?ata?eµ?µ??e? t?µ?? ap? 0
??? 1.000.000 ?/0 td ?p????????a ts S????????
?????? ?a? ?????? ?p????s?? (apa?t??µe???
??????) 10 t?p??es?e? D d?aµe?????ta? ??????t?a,
?s? a???µ? p?e??d?? se ???e t?p??es?a, ?????
??p??a se??? ? d?aµe?????ta? ??????t?a, µe ß?s?
t? sal, sal ? 100.000, 100.000 lt sal ? 200.000
??p ??t???afa t?? sal ? 100.000 se ???e t?p??es?a
58?pe?e??as?a ???t?se??
- ?ata?eµ?µ??? ??t??es? t?? s?????s??
- R1 Join R2 Join R3 Join Rn
59?pe?e??as?a ???t?se?? (a?a?efa?a??s?)
- ?atas?e?? ?????? p????? a?t??at?stas? s??se??
µe ta teµ???a t??? -gt p??te???µe?a t?p??? p???a - ?p?????sµ?? ???? t?? p????? - ep????? a?t?? µe t?
µ????te?? ??st?? - ??af??? 1 ??st?? ep????????a?
- ??af??? 2 ??p??? a?t???µ?a ???e ??µß?? (d??ad?,
???e ??µß?? ap?fas??e? t?p??? t?? ?a??te?? t??p?
?a ?p?????se? ???e t?p??? ?p?-e??t?s? - ??af??? 3 ???? t??p?? ?p?????sµ?? ?ata?eµ?µ????
s?????s??
60T?µata
- ?p????e?s? ?ed?µ???? (d?aµ???s?, a?t???afa
(?µ???t?pa) - ?pe?e??as?a ???t?se??
- ?pe?e??as?a ??s???????
61???µ???s? ?ata?eµ?µ???? ?ed?µ????
- ??a?e???s? a?t????f??
- ?ata?eµ?µ??? ??a?e???s? ??s???????
- ?ata?eµ?µ??? ??????s? ap? ?p?t???a?
62???µ???s? ?ata?eµ?µ???? ?ed?µ????
- ????ap?? a?t???afa ded?µ????
- S??????? ???µ???s? ??t????f?? ??a ta a?t???afa
µ?a? t??p?p???µ???? s??s?? (teµ???a) p??pe? ?a
t??p?p??????? p??? t?? ep?????s? t?? d?s?????a? - ? ?ata??µ? t?? ded?µ???? e??a? ad?afa???
(transparent) st??? ???ste? - ?s??????? ???µ???s? ??t????f?? ?a a?t???afa
µ?a? s??s?? e??µe?????ta? pe???d???, d?af??et???
a?t???afa µp??e? sta e?d??µesa d?ast?µata ?a µ??
e??a? e??µe??µ??a (out of synch) - ?? ???ste? ????????? t?? ?ata??µ? t?? ded?µ????
- ????? eµp????? s?st?µata a????????? a?t?? t??
p??s????s?
63S??????? ???µ???s? ??t????f??
- ????d?? t?? ??e????f?a? ??a d?s?????a p??pe? ?a
????e? t?? p?e????f?a t?? a?t????f?? ??a ?a
t??p?p???se? ??a a?t??e?µe?? -- p??pe? ?a
d?aß?se? a??et? a?t???afa ?ts? ?ste ?a de?
t??????st?? ??a ?a??????? (p?? p??sfat?)
a?t???af? - G?a pa??de??µa, 10 a?t???afa, 7 ?a ??af??? ??a
t??p?p???s?, 4 a?t???afa ??a a?????s? - ???e a?t???af? ??e? ??a? a???µ? ??d?s??
- ???ß??µa ??at? s?????? ?? a?a???se?? e??a? p??
s????? ap? t?? e???af??
64S??????? ???µ???s? ??t????f??
- Read-any Write-all ?e t? µ???d? t??
p?e????f?a?, ?? e???af?? e??a? a???? ?a? ??
a?a???se?? p?? ??????e? - ? p?? s?????sµ??? p??s????s? st? s???????
e??µ???s? a?t????f?? - ? ep????? t?? te?????? ?a?????e? p??a ??e?d??
p??pe? ?a ??t?????
65S??????? ???µ???s? ??t????f??
- ???? ep??????e? µ?a d?s?????a (p?? pe???aµß??e?
t??p?p???se??) p??pe? ?a ap??t?se? ??e?d?? se ??a
ta t??p?p???µ??a a?t???afa - St???e? a?t?se?? ??a ??e?d?? se ap?µa???sµ?????
??µß??? ?a? e?? pe??µ??e? ??a ap??t?s? ??at? ta
???a ??e?d?? - ?? ??a? ??µß?? ? µ?a s??des? p?se? (ap?t??e?), ?
d?s?????a de µp??e? ?a ep??????e? µ???? ?a
ep?st?????? se ?e?t?????a - ???µa ?a? a? de? ?p???e? ap?t???a, ? ep?????s?
p??pe? ?a a???????se? ??a a???ß? p??t??????
ep?????s?? (commit protocol) µe p???? µ???µata. - ? ?s??????? e??µ???s? t?? a?t????f??
66?s??????? ???µ???s? ??t????f??
- ?p?t??pe? t?? ep?????s? (commit) µ?a? d?s?????a?
p??? ?a ep??????e? ? e??µ???s? ???? t??
a?t????f?? (?a? ?? a?a???se?? µp??e? ?a d?aß?????
µ??? ??a a?t???af?). - ?? ???ste? ????????? p??? a?t???af? d?aß????? ?a?
?t? ta a?t???afa µp??e? ?a µ?? e??a? e??µe??µ??a
??a ??p??a µ???? ??????? d?ast?µata - ??? p??se???se?? ???te??? ??µß?? (primary site)
?a? Peer-to-Peer B?se? t?? a???µ?? t??
a?t????f?? p?? µp????? ?a e??µe?????? (master
copies)
67?s??????? ???µ???s? ??t????f??
- ???te???sa ??t???af?
- ???p?p???s? a???ß?? e??? a?t????f?? µ?a? s??s??
(a?t??e?µ????) ?a?a?t????eta? ?? p??te??? ?
master a?t???af?. ??t???afa se ?????? ??µß??? de
µp????? ?a t??p?p??????? ?µesa. - ?????p??e?ta? p??? e??a? t? p??te??? a?t???af?.
- ?? ????? ??µß?? e????f??ta? se (teµ???a) t??
s??s??, e??a? de?te?e???ta a?t???afa.
68?s??????? ???µ???s? ??t????f??
- ?as??? T?µa ??? ?? t??p?p???se?? st? p??te???
a?t???af? µetad?d??ta? sta de?te?e???ta a?t???afa - G??eta? se d?? ß?µata
- ??t?p?sµ?? t?? a??a???
- ?fa?µ??? t?? a??a???
69?s??????? ???µ???s? ??t????f??
??t?p?sµ?? t?? ???a???
- Log-Based ??t?p?sµ?? ?? ?µe??????? t??
s?st?µat?? (log) p?? ??ate?ta? ??a a?????s?
???s?µ?p??e?ta? ??a t? d?µ??????a e??? p??a?a p??
?a?e?ta? Change Data Table (CDT). - ?? a?t? ???eta? ?ta? t? log tail ???feta? st?
d?s?? t?te µe ??p??? t??p? ?a sß?st??? ??
t??p?p???se?? p?? ?fe????ta? se d?s?????e? p??
ap????pt??ta? a???te?a. - ??ad??ast???? ??t?p?sµ?? ??a d?ad??as?a
?a?e?ta? a?t?µata (s?????? pa???e? ap??? ??a
st??µ??t?p?). - ? Log-Based e?t?p?sµ?? e??a? ?a??te???
(f????te???, p?? ????????) a??? ßas??eta? se
proprietary ?ept?µ??e?e? t?? log.
70?s??????? ???µ???s? ??t????f??
?fa?µ??? t?? ???a???
- ? d?ad??as?a t?? efa?µ???? t?? a??a??? st?
de?te?e???ta ??µß? d??eta? pe???d??? ap? t??
p??te???ta ??µß? ??a st??µ??t?p? ? t?? a??a???
?a? t??p?p??e? t? a?t???af?. - ? pe???d?? e?te ????eta? ap? t? ???st? ? t??
efa?µ??? e?te ßas??eta? st? ?????. - Log-Based e?t?p?sµ?? ?a? s??e??? efa?µ??? t??
a??a??? e?a??st?p??e? t?? ?a??st???s? st?
µet?d?s? t?? a??a???. - ??ad??ast???? e?t?p?sµ?? ?a? efa?µ??? p??
?a?????eta? ap? t?? efa?µ???? e??a? ? p??
e?????t?? t??p?? ??a t? d?a?e???s? t?? a??a???.
71?s??????? ???µ???s? ??t????f??
- ?µ?t?µ??
- ?e??ss?te?a ap? ??a master a?t???afa e???
a?t??e?µ???? (a?t???afa p?? µp??e? ?a
t??p?p???????) - ???p?p???se?? ??p???? master a?t????f?? p??pe?
??p?? ?a µetad????? sta ???a a?t???afa - ?ta? d?? master a?t???afa t??p?p?????ta? µe
s???????µe?? t??p?, p??pe? ?a d?e??et????? ??
s??????se?? (p.?., ??µß?? 1 ? ?????a t?? Joe
???a?e se 35 ??µß?? 2 se 36) - ???t?µ?te?? ?ta? de? s?µßa????? s??????se??
- ?.?., ???e master ??µß?? ?at??e? ??a ???? teµ????
- ?.?., t??p?p???s? d??a??µ?t?? p?? ?at????ta? ap?
??a master t? f???
72?ata?eµ?µ??? ??e?d?µa ??t????f??
??? ???eta? ? d?a?e???s? t?? ??e?d??? ??a
ded?µ??a st??? d?af??et????? ??µß???
- ?e?t???? (Centralized) ??a? ??µß?? e??a?
?pe?????? ??a t? d?a?e???s? ???? t?? ??e?d???. - ?p?t???a t?? ??µß??
- ???te??? a?t???af? ? d?a?e???s? t?? ??e?d???
??a ??a a?t??e?µe?? ???eta? st?? ??µß? ?p??
ß??s?eta? t? p??te??? a?t???af? t?? a?t??e?µ???? - ? a?????s? apa?te? p??sp??as? ?a? st?? ??µß? p??
d?a?e????eta? ta ??e?d?? ?a? t?? ??µß?? ?p??
e??a? ap????e?µ??? t? a?t??e?µe??. - ?????? ?ata?eµ?µ??? ? d?a?e???s? t?? ??e?d???
??a ??a a?t???af? ???eta? st?? ??µß? p??
ß??s?eta? t? a?t???af? - ? e???af? apa?te? ??e?d?? se ????? t??? ??µß???
73?ata?eµ?µ??? ?????e?s? ?d?e??d??
- ???e ??µß?? d?at??e? ??a? t?p??? ???f? a?aµ????
(waits-for graph) - ??a ????? ad????d? µp??e? ?a d?µ???????e? a??µa
?a? a? ?? t?p???? ??µß?? de? pe??????? ???????
T1
T1
T1
T2
T2
T2
??µß?? A
??µß?? B
?????? G??f??
74?ata?eµ?µ??? ?????e?s? ?d?e??d??
- ??e?? ??se??
- ?e?t????p???µ??? (- pe???d??? - ap?st??? ???? t??
t?p???? ???f?? se ??a? ??µß?) - ?e?a????? (??????s? ??µß?? se µ?a ?e?a???a ?a?
ap?st??? ???f?? st?? ????a st?? ?e?a???a) - ?p??es? ?t? s???? ad????da a??µesa se
s?s?et???µe???? ??µß??? - ?e???d??? ap?st???
- Timeout (ap?????? µ?a? d?s?????a? a? pe??µ??e?
??a p??a p???). - ??t???µ?a
- ?d????da fa?t?sµata (???? t?? ?a??st???s??
?atas?e??? t?? ???f??) - ??t?st????? deadlock prevention
T1
T2
75?ata?eµ?µ??? ????aµ??
- ??? ??a ??µata
- ??? ??a e?d?? ap?t?????, p.?., s??d?se?? ?a?
ap?µa???sµ???? ??µß??. - ?? tµ?µata µ?a? d?s?????a? e?te????ta? se
d?af??et????? ??µß??? ??e? ? ?aµ?a p??pe? ?a
ep????????? ? p??t?????? ep?????s??. - ??at??e?ta? ??a log se ???e ??µß?, ?p?? ?a? sta
?e?t???? S??? st? ?p??? ?ata???f??ta? ?a? ??
p???e?? t?? p??t???????
76???t?????? ?p?????s?? ??? F?se??
???t?????? ?p?????s?? ??? F?se?? (Two Phase
Commit Protocol 2PC)
- ? ??µß?? ap? t?? ?p??? ?e????se µ?a d?s?????a
e??a? ? s??t???st?? (coordinate) -- ?? ?p????p??
??µß?? p?? s?µµet????? st?? e?t??es? t??
d?s?????a? ??????ta? ?? s?µµet????te? ?
e?a?t?µ???? (subordinates).
77???t?????? ?p?????s?? ??? F?se??
- ?ta? µ?a d?s?????a p??pe? ?a ep??????e?
- F?s? 1
- ? s??t???st?? st???e? ??a µ???µa prepare
(p??et??µas?a?) se ????? t??? s?µµet????te?
??µß???. - ???e s?µµet???? ??µß?? force-writes µ?a e???af?
abort ? prepare st? log ?a? µet? st???e? ??a
µ???µa no ? yes st?? s??t???st?. - (d??ad? sta ?ata?eµ?µ??a s?st?µata
?p?????? e?d???? e???af?? st? log s?et???? µe t?
p??t?????? ep?????s??)
78???t?????? ?p?????s?? ??? F?se??
- F?s? 2
- ?? ? s??t???st?? de??e? µ???µata yes ap? ?????,
force-writes µ?a e???af? commit st? log ?a? µet?
st???e? ??a µ???µa commit se ????? t???
s?µµet????te? ??µß???. ??????, force-writes µ?a
e???af? abort st? log ?a? µet? st???e? ??a µ???µa
abort. - ???e s?µµet???? ??µß?? ß?se? t?? µ???µat?? p??
d??eta?, force-writes µ?a e???af? abort/commit
st? log, ?a? µet? st???e? ??a µ???µa ack st??
s??t???st?. - ? s??t???st?? af?? ??ße? ??a ta acks ???fe? µ?a
e???af? end st? log.
79???t?????? ?p?????s?? ??? F?se??
- ??? ????? ep????????a? p??ta ??f?f???a (voting)
?a? µet? te?µat?sµ??. ?a? ?? d?? ?e?????? ap? t??
s??t???st?. - ?p???sd?p?te ??µß?? µp??e? ?a ap?fas?se? ?a
ap?????e? µ?a d?s?????a. - ???e µ???µa a?t?st???e? se µ?a ap?fas? t??
ap?st???a ??a t?? a?t?µet?p?s? t?? ap?t?????
a?t? ? ap?fas? ?ata???feta? st? t?p??? log (p???
sta?e?) - ??e? ?? e???af?? st? log p?? af????? t?
p??t?????? ep?????s?? pe??????? t? id t??
d?s?????a? Xactid ?a? t? id t?? ??µß?? t??
s??t???st? Coordinatorid. ?? e???af??
abort/commit st? s??t???st? pe??????? ta ids ????
t?? ??µß?? p?? s?µµet????? - G?a ße?t??s? t?? ap?d?s??, ? s??t???st?? µp??e?
?a µ? ste??e? µ???µata abort st??? ??µß??? p??
??f?sa? ???.
80???t?????? ?p?????s?? ??? F?se??
- ????µata Ack ???s?µ?p?????ta? ??a ?a e?d?p???s???
t?? s??t???st? ?t? µp??e? ?a ?e??se? t?
d?s?????a, µ???? ?a ??ße? a?t? t? µ???µa p??pe?
?a ??at? t? d?s?????a st?? p??a?a d?s??????? - ?? ? s??t???st?? ap?t??e? af?? ste??e? µ???µata
prepare a??? p??? ????e? t?? e???af??
commit/abort, t?te ???e? t? d?s?????a abort - ?? ? d?s?????a de? pe???aµß??e? e??µe??se??, t?te
de? ??e? s?µas?a a? ???e? commit ? abort
81???t?????? ?p?????s?? ??? F?se??
?pa?af??? ap? ?p?t???a
- ?? ??a µ?a d?s?????a ? ????µe µ?a e???af? commit
? abort a??? de? ????µe µ?a e???af? end, p??pe?
? ? ?a ???e? ? redo ? undo - ?? a?t?? ? ??µß?? e??a? ? s??t???st?? ??a t?? T,
?a p??pe? ?a s??e??se? ?a st???e? µ???µata
commit/abort µ???? ?a ??ße? acks ap? ????? t???
s?µµet????te? ??µß???
82???t?????? ?p?????s?? ??? F?se??
?pa?af??? ap? ?p?t???a
- ?? ??a µ?a d?s?????a ? ????µe µ?a e???af? prepare
a??? de? ????µe µ?a e???af? commit/abort, a?t?? ?
??µß?? p??pe? ?a e??a? s?µµet???? ??µß?? - ?pa?a??pt??? ep???????e? µe t? s??t???st? ??a ?a
ß?e? t?? ?at?stas? t?? ?, - ???fe? e???af?? commit/abort st? log
- redo/undo T
- ???fe? e???af?? end st? log
83???t?????? ?p?????s?? ??? F?se??
?pa?af??? ap? ?p?t???a
- ?? ??a µ?a d?s?????a ? de? ????µe ??te µ?a
e???af? prepare, abort ? undo T. - ??t?? ? ??µß?? µp??e? ?a e??a? ? s??t???st??. Se
a?t?? t?? pe??pt?s? µp??e? ?? s?µµet????te? ?a
ste????? µ???µata. - ??te d?ap?st??e? ? ??µß?? ?t? ?ta? ? s??t???st??
?a? apa?t? a???t???
84???t?????? ?p?????s?? ??? F?se??
- ?? ? s??t???st?? ??a t?? T ap?t??e?, ??
s?µµet????te? ??µß?? p?? ????? ??f?se? yes de?
µp????? ?a ap?fas?s??? a? ?a p??pe? ?a
ep?????s??? ? ?a a????s??? t?? T µ???? ?a
a?a???se? ? s??t???st??. - T e??a? ap???e?sµ??? - blocked.
- ???µa ?a? a? ???? ?? s?µµet????te? ??µß??
????????? ? ??a? t?? ???? (ep?p???? overhead sta
µ???µata prepare) de? µp????? ?a ap?fas?s???
e?t?? a? ??a? ap? a?t??? ??e? ??f?se? no
85???t?????? ?p?????s?? ??? F?se??
- ?? ??a? ??µß?? de? ap?????eta? se ??a? ??µß? x
?at? t? d????e?a t?? p??t??????? ep?????s??
epe?d? e?te ? ??µß?? e?te ? s??des? ??e?
ap?t??e? - ?? ? ??µß?? x e??a? ? s??t???st??, p??pe? ?a
ap?????e? t?? T. - ?? ? ??µß?? x e??a? s?µµet????, ?a? de? ??e?
a??µa ??f?se? yes, p??pe? ?a ap?????e? t?? T. - ?? ? ??µß?? x e??a? s?µµet????, ?a? ??e? ??f?se?
yes, p??pe? ?a pe??µ??e? µ???? ?a ap?????e? ?
s??t???st??
86???t?????? ?p?????s?? ??? F?se??
- ?e?t??se??
- ?ta? ? s??t???st?? aborts T, µp??e? ?a t??
ap?µa????e? ap? t?? p??a?a s??a??a??? - ?ta? ??a? s?µµet???? ap?fas?se? abort, de
??e???eta? ?a pe??µ??e? ack - ?a? µ?a se??? a?t?st???e? ße?t?st?p???se??
87?e??????
- ?a ?ata?eµ?µ??a S??? p??sf????? a?t???µ?a se ???e
??µß? ?a? ?ata?eµ?µ??? d?a?e???s?. ??e?????ta?
??e? te?????? - ap????e?s??,
- d?a?e???s?? t?? ?ata?????,
- epe?e??as?a? e??t?se??
- e?????? s??d??µ???t?ta? ?a? a???aµ???.
88?a??????e? ??se?? ?ed?µ????
89 ????te?t?????? S?st?µ?t?? ??se?? ?ed?µ????
- S???e?t??t??? s?st?µata ??
- S?st?µata pe??t? - e??p??et?t? (client-server)
- ?a??????a s?st?µata ??
- ?ata?eµ?µ??a s?st?µata ??
90Se t? ??e???eta? ? pa?a?????sµ??
?e 10 MB/s 1.2 µ??e? ??a scan
1,000 x parallel 1.5 ?ept? ??a scan.
1 Terabyte
Bandwidth
1 Terabyte
10 MB/s
pa?a?????sµ?? d??spas? e??? µe????? p??ß??µat??
se µ????te?a ta ?p??a ?a ?????? pa??????a
91?a??????a S?st?µata
- ?a pa??????a s?st?µata ?? ap?te????ta? ap? ??a
s????? p????? epe?e??ast?? ?a? p????? d?s???
d?as??dedeµ???? se ??a ??????? d??t??. - ??a coarse-grain pa??????? µ??a?? ap?te?e?ta? ap?
??a µ???? a???µ? ?s????? epe?e??ast??
(???t????????) - ??a µa???? pa??????? (massively parallel) ? fine
grain pa??????? µ??a?? ???s?µ?p??e? ?????de?
µ????te???? epe?e??ast?? (?ept???????)
92?a??????a S?st?µata
- ?e?t??s? t?? ap?d?s?? µ?s?? t?? ???p???s??
pa???????? ?e?t??????? - ?ata??µ? ded?µ???? µe st??? t? ße?t??s? t??
ap?d?s?? - Se ?ata?eµ?µ??? s?st?µa
- ?a ded?µ??a e??a? se f?s??? ep?ped? ap????e?µ??a
se d?af??et????? ??µß??? a?t???µ?a ??µß??
93?a?ade??µata ???t??? ??as??des??
94????te?t?????? ?a???????? S??
- ??aµ???asµ??? µ??µ? (shared memory) ??
epe?e??ast?? µ???????ta? ????? µ??µ? - ??aµ???asµ??? s?st?µa d?s??? (shared disk) ??
epe?e??ast?? µ???????ta? ????? s?st?µa d?s??? - ??p?ta d?aµ???asµ??? (shared nothing) ??
epe?e??ast?? ??? µ???????ta? ??te ????? µ??µ?
??te ????? d?s?? - ?e?a????? ?ß??d??? a???te?t????? s??d?asµ??
t?? a??t???
95????te?t?????? ?a???????? S??
96????te?t?????? ?a???????? S?? (s??.)
- ??aµ???asµ??? µ??µ? (shared memory)
- ?d?a?te?a ap?d?t??? ep????????a µeta?? t??
epe?e??ast??. ???? p??spe?a????? ta ded?µ??a st??
(?????) µ??µ? ????? ?a ??e???eta? ?a ta
µeta????s??? ap? e?e?. - ???ß??µa de? ???µa???eta? p??a ap? 32 ? 64
epe?e??ast?? ?a??? p???a?e?ta? ?????f???a??
s?µf???s? (bottleneck) st?? d?a??? µ??µ??.
S?????? ???s?µ?p??e?ta? ??a ?aµ??? ßa?µ?
pa?a?????sµ?? (4-8).
97????te?t?????? ?a???????? S?? (s??.)
- ??aµ???asµ??? s?st?µa d?s??? (shared disk)
- ? d?a???? µ??µ?? de? e??a? p?a p??ß??µa a??? t??a
? ?????f???a?? s?µf???s? s?µßa??e? st? s??des? µe
t? s?st?µa d?s??? - ????? sfa?µ?t?? (fault-tolerance). ??? ap?t??e?
??a? epe?e??ast??, ?? ?p????p?? a?a?aµß????? t??
e??as?e? t?? af?? ? ?? e??a? ap????e?µ??? se
d?s???? p??spe??s?µ??? ap? ????? - ???µ???s? se ??p?? µe?a??te?? a???µ? epe?e??ast??
- ?a p??ta eµp????? s?st?µata IBM Sysplex ?a? DEC
clusters (t??a Compaq) p?? ?t?e?a? Rdb (t??a
Oracle Rdb)
98????te?t?????? ?a???????? S?? (s??.)
- ??p?ta d?aµ???asµ??? (shared nothing)
- ??a? ??µß?? ap?te?e?ta? ap? ??a? epe?e??ast?,
µ?a µ??µ? ?a? ??a s?st?µa d?s???. ?? ??µß?? e??a?
s??dedeµ???? µeta?? t???. ???e ??µß?? pa??e? t?
???? t?? e??p??et?t? ??a ta ded?µ??a p?? e??a?
ap????e?µ??a st? s?st?µa d?s??? t??. - ? ???µ???s? µp??e? ?a ???e? se ?????de?
epe?e??ast?? - ???ß??µa ??st?? ep????????a? µeta?? epe?e??ast??
?a? ? p??sp??as? ded?µ???? se µ? t?p????? d?s????
(apa?te?ta? ????sµ??? ap?st???? ded?µ???? ap? t?
??a? ??µß? st?? ????) - ?µp????? s?st?µata Teradata, Tandem, Oracle-n
CUBE
99????te?t?????? ?a???????? S?? (s??.)
- ?e?a????? a???te?t?????
- ?? a??te?? ep?ped? µp??e? ?a a??????e? t??
a???te?t????? t?p?ta d?aµ???asµ???? e??
es?te???? ???e ??µß?? µp??e? ?a e??a?
d?aµ???asµ???? µ??µ?? ? d?aµ???asµ???? s?st?µat??
d?s??? (se p???? ep?peda)
100?a?ade??µata ?a???????? S?st?µ?t?? (9/1995)
Shared Nothing Teradata 400 nodes Tandem
110 nodes IBM / SP2 / DB2 128 nodes Informix/SP2
48 nodes ATT Sybase ?
nodes Shared Disk Oracle 170 nodes DEC Rdb
24 nodes Shared Memory Informix 9 nodes
RedBrick ? nodes
101??t?a ?p?d?s??
- ??? ????a µ?t?a ap?d?s??
- ???µ?? e??d?? ? ????????s?? (throughput) ?
a???µ?? t?? e??as??? p?? µp????? ?a ????????????
se s???e???µ??? ??????? d??st?µa - ?????? ap????s?? (response time) ? ?????? p??
apa?te?ta? ??a ?a ?????????e? µ?a e??as?a ap? t?
st??µ? p?? ?a ?p?ß???e?
102??t?a ?p?d?s??
- ?p?t????s? (Speed-Up)
- ?e??ss?te??? p???? s?µa??e? a?a??????
????te??? ?????? ??a ??a d?sµ??? p?s?t?ta
ded?µ????
?da????
Xact/sec. (throughput)
degree of -ism
103??t?a ?p?d?s??
- ???µ???s? (Scale-Up)
- ?? ?? p???? a??????ta? se a?a????a µe t?
µ??e??? ded?µ????, ? ?????? e??a? sta?e???
?da????
Xact/sec. (throughput)
degree of -ism
104??t?a ?p?d?s??
- ???µ???s? (Scale-Up)
- ?? ?? p???? a??????ta? se a?a????a µe t?
µ??e??? ded?µ????, ? ?????? e??a? sta?e???
sec./Xact (response time)
?da????
degree of -ism
105????te?t?????? ?a???????? S??
??aµ???a??µe??? ???µ?? Shared Memory (SMP)
??p?ta d?aµ???asµ??? Shared Nothing (d??t?a???)
??aµ???a??µe??? ??s??? Shared Disk
CLIENTS
CLIENTS
CLIENTS
Processors
Memory
?????? st?? p????aµµat?sµ? ????ß? st??
?atas?e?? ??s???? ???µ???s?
??a µ?s? ep?ß????s? 1 ??a ???e ep?p??s?et? CPU
s?µa??e? ?t? ? µ???st? ep?t????s? e??a? 37,
p??s?es? ???? CPU ?d??e? se ep?ß??d??s?, 1000 CPU
µ??? 4 p?? ??????e? ap? ??a s?st?µa µe 1 CPU
Sequent, SGI, Sun
106????te?t?????? ?a???????? S??
??aµ???a??µe??? ???µ?? Shared Memory (SMP)
??p?ta d?aµ???asµ??? Shared Nothing (d??t?a???)
??aµ???a??µe??? ??s??? Shared Disk
CLIENTS
CLIENTS
CLIENTS
Processors
Memory
?????? st?? p????aµµat?sµ? ????ß? st??
?atas?e?? ??s???? ???µ???s?
??s???? st?? p????aµµat?sµ? ??????µ??? st??
?atas?e?? ?????? ???µ???s?
VMScluster, Sysplex
Sequent, SGI, Sun
Tandem, Teradata, SP2
107??p?? ?a?a?????a?
- ?a?a?????sµ?? µ?s? s?????t?? e?t??es?? (pipeline
parallelism) p????? µ??a??? p?? ? ?a?eµ?a
e?te?e? ??a ß?µa µ?a? d?ad??as?a? p????? ß?µ?t??
(µp?????e? pe??µ????ta? ta ap?te??sµata t??
p??????µe???) - ?a?a?????sµ?? µe d??spas? (partition parallelism)
? d?aµ???a??µe?? ded?µ???? p????? µ??a??? p??
e?te???? t?? ?d?a ?e?t?????a se d?af??et???
tµ?µata t?? ded?µ???? - ?a? ?? d?? t?p?? pa?a?????sµ?? e??a? d??at?? sta
S???
Any
Any
Sequential
Sequential
Pipeline
Program
Program
Sequential
Any
Any
Partition
Sequential
Sequential
Sequential
Sequential
Sequential
Program
Program
outputs split N ways, inputs merge M ways
108S??? ? ep?t???a t?? pa?a?????sµ??
- S??? ep?t???µ??a µ??t??a pa?a?????sµ??
- Teradata, Tandem vs. Thinking Machines, KSR.
- ???e s?µa?t??? eµp????? S??? ??e? ??p???
e??p???t? - ????? t?? ep?t???a?
- ?e???? p?s?t?ta ded?µ???? - Bulk-processing (
pa?a?????sµ?? d?aµe??sµ??). - F?s??? d?as?????s?.
- Ft??? ????? (hardware)
- ??af??e?a pa?a?????sµ?? ??a t? ???st?/p????aµµat?s
t? efa?µ????
109??aµe??sµ?? ?ed?µ????
??aµe??sµ?? µ?a? s??s??
??ast?µata ??µ?? ?ata?e?µat?sµ?? Round Robin
A...E
F...J
F...J
T...Z
A...E
K...N
O...S
T...Z
F...J
K...N
O...S
T...Z
K...N
O...S
A...E
?a????µ?s?, ep????? n pe?????? ?ts? ?ste ???e
pe????? ?a pe????e? pe??p?? t?? ?d?? a???µ?
p?e??d??, p?e??de? st? d??st?µa i st??
epe?e??ast? i
110??aµe??sµ?? ?ed?µ????
??ast?µata ??µ?? Kata?e?µat?sµ?? Round Robin
A...E
F...J
F...J
T...Z
A...E
K...N
O...S
T...Z
F...J
K...N
O...S
T...Z
K...N
O...S
A...E
??a s????t?s? ?ata?e?µat?sµ?? efa?µ??eta? se
ep??e?µ??a ?????sµata ???e p?e??da? ?a? µa? d??e?
t?? a???µ? t?? epe?e??ast?
111??aµe??sµ?? ?ed?µ????
??ast?µata ??µ?? Kata?e?µat?sµ?? Round Robin
A...E
F...J
F...J
T...Z
A...E
K...N
O...S
T...Z
F...J
K...N
O...S
T...Z
K...N
O...S
A...E
H i-?st? p?e??da p?e? st?? i mod n epe?e??ast?
112??aµe??sµ?? ?ed?µ????
- Round robin ?a?? ??a p??sp??as? ???? t?? s??s??
- ?? µ??? ??a ?p?s????? t?? s??s??, d?aµe??sµ??
d?ast?µat?? t?µ?? ?a? ?ata?e?µat?sµ?? (a?
?s?t?ta) ?a??te?a a? ß?ßa?a ? ep????? af??? ta
?d?a ?????sµata - ?p????? pe??????, t?te d?aµe??sµ?? d?ast?µat??
t?µ?? ?a??te?? - ?? data skew a??µ???µ??f? ?ata??µ? ded?µ???? -
p??ß??µa - ??a d??at? ??s? e??a? ? de??µat?????a
113??aµe??sµ?? ?ed?µ????
??ast?µata ??µ?? ?ata?e?µat?sµ?? Round Robin
A...E
F...J
F...J
T...Z
A...E
K...N
O...S
T...Z
F...J
K...N
O...S
T...Z
K...N
O...S
A...E
?a??? ??a s??e??se?? ?s?t?ta?
?a??? ??a s??e??se?? ?s?t?ta?, ???t?se??
pe?????? ?µad?p???s?
?a??? t??p?? ??a ?ataµe??sµ? f??t???
????te?t?????? d?aµ???a??µe??? d?s??? ?a? µ??µ??
????te?? e?a?s??te? st? d?aµe??sµ? ??? s?µa?t????
??a t?? a???te?t?????? ??p?ta ??aµ???a??µe??
114?a?a?????sµ?? Se???a??? ??d??a
- ???spas?, split
- S?????s?, merge
- d??t?? ???? ded?µ???? (data flow network)
115??af??et???? ??p?? ?a?a?????sµ?? se S???
- ?a??????? e?t??es? µ?a? p????? (Intra-operator
parallelism) - ??e? ?? µ??a??? e??????ta? st?? e?t??es? µ?a?
s???e???µ???? p????? (scan, sort, join) - ?a??????? e?t??es? p????? p???e?? (Inter-operator
parallelism) - ???e p???? µp??e? ?a e?te?e?ta? ta?t?????a se
d?af??et????? ??µß??? (?a? ???s? s?????t??
e?t??es??) - ?a??????? e?t??es? e??t?se?? (Inter-query
parallelism) - d?af??et???? e??t?se?? e?te????ta? se
d?af??et????? ??µß??? - Ta ep??e?t?????µe st? p?? µp????µe ?a
e?te??s??µe pa??????a µ?a p???? (intra-operator
-ism)
116?a??????? S???s? (Scan)
- S???s? pa??????a, µet? s?????e?s?
- ??a ep????? µp??e? ?a µ?? apa?te? t?? p??sp??as?
???? t?? ??µß?? st?? pe??pt?s? t?? d?aµe??sµ??
d?ast?µat?? ? ?ata?e?µat?sµ??. - ?p????µe ?a d?at????µe e??et???a se ???e ??µß?
(??a ???e tµ?µa ded?µ????).
117?a??????? ?a????µ?s?
- S?µe???? ap?d?s?
- 8.5 Gb/minute, shared-nothing Datamation
benchmark in 2.41 secs (UCB students!
http//now.cs.berkeley.edu/NowSort/) - ?d?a ta????µ?s? t?p??? ?a? µet? s?????e?s?
- ?a??te?? ?d?a
- ?a??????? s???s? ?a? ta?t??????? d?aµe??sµ?? se
d?ast?µata t?µ?? - ?a????µ?s? t?? t?µ?? t?p??? (se ???e ??µß?)
- O? ap?t??esµa ta ded?µ??a e??a? ta????µ?µ??a ?a?
d?aµ???asµ??a se d?ast?µata t?µ?? - ???ß??µa skew! (a??µ???µ??f? ?ata??µ?)
- ??s? de??µat?????a t?? ded?µ???? st?? a???
?ste ?a ?a????st??? ta s?µe?a d??spas??
(splitting vector d????sµa d?a????sµ??)
118?a??????e? S??a????st????
- G?a ???e s??a????st??? s????t?s? ??e???eta? µ?a
d??spas? (decomposition) - count(S) S count(s(i)), t? ?d?? ??a t? sum()
- avg(S) (S sum(s(i))) / S count(s(i))
- ??? ...
Jim Gray Gordon Bell VLDB 95 Parallel
Database Systems Survey
119?a??????e? S??e??se??
- ?µf??e?µ???? ??????? (Nested loop)
- ???e e??te???? p?e??da p??pe? ?a s??????e? µe
???e es?te???? p?e??da µe t?? ?p??a ?s??
s??e???eta? - ?????? ?ta? ????µe d?aµ???asµ? d?ast?µ?t?? t?µ??
st? ?????sµa p?? ?a ???e? ? s?????s?, d?s????
a????? - S?????s? af?? ???e? ta????µ?s? Sort-Merge
- ? ta????µ?s? d??e? d?a????sµ? d?ast?µ?t??.
- ???ß??µa a?t?µet?p?s?? d?? µ? ?µ???µ??f??
?ata??µ??
120?a??????? s?????s? µe ?ata?e?µat?sµ?
Phase 1
- St?? p??t? f?s?, ta tµ?µata ?ata??µ??ta? se
d?af??et????? ??µß??? - ??a ?a?? s????t?s? ?ata?e?µat?sµ?? ?ste
?µ???µ??f? ?ata??µ? t?? d???e??? - S?????s? se ???e ??µß?
121???t?? ???? ??a S?????s?
122?a?a?????sµ?? ?????? ??t??es?? ???t?s??
- S???ete? e??t?se?? Inter-Operator pa?a?????sµ??
- S?????s? µeta?? te?est??
- ? ta????µ?s? ?a? ? p??t? f?s? t?? s?????s?? µe
?ata?e?µat?sµ? µp???????? t? s?????s? - Bushy (?aµ??d? d??t?a)
Sites 1-8
Sites 1-4
Sites 5-8
123?a?at???s?
- ? ße?t?st?p???s? pa???????? p????? e?t??es??
e??a? d?s????
124?a??????? ße?t?st?p???s? e??t?se??
- ????? ???s????s? 2 f?se??
- ?p????? t?? ?a??te??? se???a??? p?????
- ?p??e?e t? ßa?µ? pa?a?????sµ??.
- ????ese te?est?? (p???e??) se ?p?????st??
- ???ad?, p??s?ese st? d??t?? e?t??es?? p????f???a
??a t? p?? ?a e?te?este? µ?a e??t?s?