Principles of distributed database systems [4 ed.] 9783030262525, 9783030262532


290 46 4MB

English Pages 681 Year 2020

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Preface......Page 6
Contents......Page 10
1.1 What Is a Distributed Database System?......Page 17
1.2 History of Distributed DBMS......Page 19
1.3 Data Delivery Alternatives......Page 21
1.4.1 Transparent Management of Distributed and Replicated Data......Page 23
1.4.2 Reliability Through Distributed Transactions......Page 26
1.4.3 Improved Performance......Page 27
1.5.1 Distributed Database Design......Page 29
1.5.4 Distributed Concurrency Control......Page 30
1.5.6 Replication......Page 31
1.5.10 Big Data Processing and NoSQL......Page 32
1.6.1 Architectural Models for Distributed DBMSs......Page 33
1.6.1.1 Autonomy......Page 34
1.6.1.3 Heterogeneity......Page 35
1.6.2 Client/Server Systems......Page 36
1.6.3 Peer-to-Peer Systems......Page 38
1.6.4 Multidatabase Systems......Page 41
1.6.5 Cloud Computing......Page 43
1.7 Bibliographic Notes......Page 47
2 Distributed and Parallel Database Design......Page 48
2.1 Data Fragmentation......Page 50
2.1.1.1 Auxiliary Information Requirements......Page 52
2.1.1.2 Primary Horizontal Fragmentation......Page 55
2.1.1.3 Derived Horizontal Fragmentation......Page 62
2.1.1.4 Checking for Correctness......Page 66
2.1.2 Vertical Fragmentation......Page 67
2.1.2.1 Auxiliary Information Requirements......Page 68
2.1.2.2 Clustering Algorithm......Page 71
2.1.2.3 Splitting Algorithm......Page 77
2.1.3 Hybrid Fragmentation......Page 80
2.2 Allocation......Page 81
2.2.1 Auxiliary Information......Page 83
2.2.2.1 Total Cost......Page 84
2.2.2.2 Constraints......Page 86
2.3 Combined Approaches......Page 87
2.3.1 Workload-Agnostic Partitioning Techniques......Page 88
2.3.2 Workload-Aware Partitioning Techniques......Page 89
2.4 Adaptive Approaches......Page 93
2.4.2 Detecting Affected Items......Page 94
2.4.3 Incremental Reconfiguration......Page 95
2.5 Data Directory......Page 97
2.6 Conclusion......Page 98
2.7 Bibliographic Notes......Page 99
Exercises......Page 101
3 Distributed Data Control......Page 105
3.1.1 Views in Centralized DBMSs......Page 106
3.1.2 Views in Distributed DBMSs......Page 109
3.1.3 Maintenance of Materialized Views......Page 110
3.2 Access Control......Page 116
3.2.1 Discretionary Access Control......Page 117
3.2.2 Mandatory Access Control......Page 120
3.2.3 Distributed Access Control......Page 122
3.3 Semantic Integrity Control......Page 124
3.3.1.1 Specification of Integrity Constraints......Page 125
3.3.1.2 Integrity Enforcement......Page 128
3.3.2 Distributed Semantic Integrity Control......Page 130
3.3.2.1 Definition of Distributed Integrity Constraints......Page 131
3.3.2.2 Enforcement of Distributed Integrity Constraints......Page 133
3.3.2.3 Summary of Distributed Integrity Control......Page 136
3.5 Bibliographic Notes......Page 137
Exercises......Page 139
4 Distributed Query Processing......Page 142
4.1.1 Query Processing Problem......Page 143
4.1.2.1 Search Space......Page 146
4.1.2.2 Cost Model......Page 147
4.1.2.3 Search Strategy......Page 148
4.1.3 Layers Of Query Processing......Page 149
4.1.3.1 Query Decomposition......Page 150
4.1.3.2 Data Localization......Page 151
4.1.3.4 Distributed Execution......Page 152
4.2 Data Localization......Page 153
4.2.1.1 Reduction with Selection......Page 154
4.2.2 Reduction with Join......Page 155
4.2.3 Reduction for Vertical Fragmentation......Page 156
4.2.4 Reduction for Derived Fragmentation......Page 158
4.2.5 Reduction for Hybrid Fragmentation......Page 161
4.3.1 Join Trees......Page 162
4.3.2 Join Ordering......Page 164
4.3.3 Semijoin-Based Algorithms......Page 166
4.3.4 Join Versus Semijoin......Page 169
4.4.1 Cost Functions......Page 170
4.4.2 Database Statistics......Page 172
4.5.1 Dynamic Approach......Page 174
4.5.2 Static Approach......Page 178
4.5.3 Hybrid Approach......Page 182
4.6 Adaptive Query Processing......Page 186
4.6.1 Adaptive Query Processing Process......Page 187
4.6.1.2 Adaptive Reactions......Page 188
4.6.2 Eddy Approach......Page 189
4.7 Conclusion......Page 190
4.8 Bibliographic Notes......Page 191
Exercises......Page 193
5 Distributed Transaction Processing......Page 196
5.1 Background and Terminology......Page 197
5.2 Distributed Concurrency Control......Page 201
5.2.1 Locking-Based Algorithms......Page 202
5.2.1.1 Centralized 2PL......Page 203
5.2.1.2 Distributed 2PL......Page 206
5.2.1.3 Distributed Deadlock Management......Page 207
5.2.2 Timestamp-Based Algorithms......Page 210
5.2.2.1 Basic TO Algorithm......Page 211
5.2.2.2 Conservative TO Algorithm......Page 214
5.2.3 Multiversion Concurrency Control......Page 216
5.2.4 Optimistic Algorithms......Page 218
5.3 Distributed Concurrency Control Using Snapshot Isolation......Page 219
5.4 Distributed DBMS Reliability......Page 222
5.4.1 Two-Phase Commit Protocol......Page 224
5.4.2 Variations of 2PC......Page 230
5.4.2.1 Presumed Abort 2PC Protocol......Page 231
5.4.2.2 Presumed Commit 2PC Protocol......Page 232
5.4.3.1 Termination and Recovery Protocols for 2PC......Page 233
5.4.3.2 Three-Phase Commit Protocol......Page 239
5.4.4 Network Partitioning......Page 240
5.4.4.2 Voting-Based Protocols......Page 243
5.4.5 Paxos Consensus Protocol......Page 244
5.4.6 Architectural Considerations......Page 247
5.5 Modern Approaches to Scaling Out Transaction Management......Page 249
5.5.2 LeanXcale......Page 250
5.6 Conclusion......Page 252
5.7 Bibliographic Notes......Page 254
Exercises......Page 257
6 Data Replication......Page 260
6.1.1 Mutual Consistency......Page 262
6.1.2 Mutual Consistency Versus Transaction Consistency......Page 264
6.2 Update Management Strategies......Page 265
6.2.1 Eager Update Propagation......Page 266
6.2.3 Centralized Techniques......Page 267
6.3 Replication Protocols......Page 268
6.3.1.1 Single Master with Limited Replication Transparency......Page 269
6.3.1.2 Single Master with Full Replication Transparency......Page 271
6.3.1.3 Primary Copy with Full Replication Transparency......Page 273
6.3.3 Lazy Centralized Protocols......Page 275
6.3.3.1 Single Master with Limited Transparency......Page 276
6.3.3.2 Single Master or Primary Copy with Full Replication Transparency......Page 278
6.3.4 Lazy Distributed Protocols......Page 281
6.4 Group Communication......Page 282
6.5 Replication and Failures......Page 285
6.5.2 Failures and Eager Replication......Page 286
6.6 Conclusion......Page 289
6.7 Bibliographic Notes......Page 290
Exercises......Page 292
7 Database Integration—Multidatabase Systems......Page 294
7.1 Database Integration......Page 295
7.1.1 Bottom-Up Design Methodology......Page 296
7.1.2 Schema Matching......Page 300
7.1.2.1 Schema Heterogeneity......Page 302
7.1.2.2 Linguistic Matching Approaches......Page 304
7.1.2.3 Constraint-Based Matching Approaches......Page 306
7.1.2.4 Learning-Based Matching......Page 307
7.1.2.5 Combined Matching Approaches......Page 308
7.1.3 Schema Integration......Page 309
7.1.4.1 Mapping Creation......Page 311
7.1.4.2 Mapping Maintenance......Page 317
7.1.5 Data Cleaning......Page 319
7.2 Multidatabase Query Processing......Page 320
7.2.1 Issues in Multidatabase Query Processing......Page 321
7.2.2 Multidatabase Query Processing Architecture......Page 322
7.2.3 Query Rewriting Using Views......Page 324
7.2.3.2 Rewriting in GAV......Page 325
7.2.3.3 Rewriting in LAV......Page 327
7.2.4.1 Heterogeneous Cost Modeling......Page 330
7.2.4.2 Heterogeneous Query Optimization......Page 337
7.2.5 Query Translation and Execution......Page 342
7.3 Conclusion......Page 345
7.4 Bibliographic Notes......Page 347
Exercises......Page 350
8 Parallel Database Systems......Page 361
8.1 Objectives......Page 362
8.2 Parallel Architectures......Page 364
8.2.1 General Architecture......Page 365
8.2.2.1 Uniform Memory Access (UMA)......Page 367
8.2.2.2 Non-Uniform Memory Access (NUMA)......Page 368
8.2.3 Shared-Disk......Page 369
8.2.4 Shared-Nothing......Page 370
8.3 Data Placement......Page 371
8.4.1 Parallel Algorithms for Data Processing......Page 374
8.4.1.1 Parallel Sort Algorithms......Page 375
8.4.1.2 Parallel Join Algorithms......Page 376
8.4.2.1 Search Space......Page 381
8.4.2.2 Cost Model......Page 384
8.4.2.3 Search Strategy......Page 385
Initialization......Page 386
Skew......Page 387
8.5.2 Intraoperator Load Balancing......Page 388
8.5.4 Intraquery Load Balancing......Page 390
8.6 Fault-Tolerance......Page 395
8.7 Database Clusters......Page 396
8.7.1 Database Cluster Architecture......Page 397
8.7.3 Load Balancing......Page 398
8.7.4 Query Processing......Page 399
8.9 Bibliographic Notes......Page 402
Exercises......Page 404
9 Peer-to-Peer Data Management......Page 407
9.1 Infrastructure......Page 410
9.1.1 Unstructured P2P Networks......Page 411
9.1.2 Structured P2P Networks......Page 414
9.1.3 Superpeer P2P Networks......Page 418
9.2.1 Pairwise Schema Mapping......Page 420
9.2.2 Mapping Based on Machine Learning Techniques......Page 421
9.2.3 Common Agreement Mapping......Page 422
9.3 Querying Over P2P Systems......Page 423
9.3.1.1 Basic Techniques......Page 424
9.3.1.2 Top-k Queries in Unstructured Systems......Page 431
9.3.1.3 Top-k Queries in DHTs......Page 433
9.3.1.4 Top-k Queries in Superpeer Systems......Page 435
9.3.2 Join Queries......Page 436
9.3.3 Range Queries......Page 437
9.4 Replica Consistency......Page 440
9.4.1 Basic Support in DHTs......Page 441
9.4.2 Data Currency in DHTs......Page 443
9.4.3.1 OceanStore......Page 444
9.4.3.3 APPA......Page 446
9.5 Blockchain......Page 448
9.5.1 Blockchain Definition......Page 449
9.5.2 Blockchain Infrastructure......Page 450
9.5.2.2 Grouping Transactions into Blocks......Page 451
9.5.2.3 Block Validation by Consensus......Page 453
9.5.3 Blockchain 2.0......Page 454
9.5.4 Issues......Page 455
9.6 Conclusion......Page 456
9.7 Bibliographic Notes......Page 457
Exercises......Page 459
10 Big Data Processing......Page 461
10.1 Distributed Storage Systems......Page 463
10.1.1 Google File System......Page 465
10.1.2 Combining Object Storage and File Storage......Page 466
10.2 Big Data Processing Frameworks......Page 467
10.2.1 MapReduce Data Processing......Page 468
10.2.1.1 MapReduce Architecture......Page 470
10.2.1.2 High-Level Languages for MapReduce......Page 472
10.2.1.3 MapReduce Implementation of Database Operators......Page 473
10.2.2 Data Processing Using Spark......Page 478
10.3 Stream Data Management......Page 482
10.3.1 Stream Models, Languages, and Operators......Page 484
10.3.1.1 Data Models......Page 485
10.3.1.3 Streaming Operators and Their Implementation......Page 486
10.3.2 Query Processing over Data Streams......Page 488
10.3.2.1 Windowed Query Execution......Page 489
10.3.2.2 Load Management......Page 490
10.3.2.3 Out-of-Order Processing......Page 491
10.3.2.4 Multiquery Optimization......Page 492
10.3.2.5 Parallel Data Stream Processing......Page 493
10.3.3 DSS Fault-Tolerance......Page 495
10.4 Graph Analytics Platforms......Page 498
10.4.1 Graph Partitioning......Page 501
10.4.2 MapReduce and Graph Analytics......Page 506
10.4.3 Special-Purpose Graph Analytics Systems......Page 507
10.4.4 Vertex-Centric Block Synchronous......Page 510
10.4.5 Vertex-Centric Asynchronous......Page 513
10.4.6 Vertex-Centric Gather-Apply-Scatter......Page 515
10.4.7 Partition-Centric Block Synchronous Processing......Page 516
10.4.9 Partition-Centric Gather-Apply-Scatter......Page 518
10.4.12 Edge-Centric Gather-Apply-Scatter......Page 519
10.5.1 Data Lake Versus Data Warehouse......Page 520
10.5.2 Architecture......Page 522
10.5.3 Challenges......Page 523
10.7 Bibliographic Notes......Page 524
Exercises......Page 528
11 NoSQL, NewSQL, and Polystores......Page 531
11.1 Motivations for NoSQL......Page 532
11.2 Key-Value Stores......Page 533
11.2.1 DynamoDB......Page 534
11.2.2 Other Key-Value Stores......Page 536
11.3.1 MongoDB......Page 537
11.3.2 Other Document Stores......Page 540
11.4.1 Bigtable......Page 541
11.5 Graph DBMSs......Page 543
11.5.1 Neo4j......Page 544
11.6 Hybrid Data Stores......Page 547
11.6.1 Multimodel NoSQL Stores......Page 548
11.6.2.1 F1......Page 549
11.6.2.2 LeanXcale......Page 550
11.7.1 Loosely Coupled Polystores......Page 552
11.7.1.1 BigIntegrator......Page 553
11.7.1.2 Forward......Page 555
11.7.2 Tightly Coupled Polystores......Page 556
11.7.2.1 Polybase......Page 558
11.7.2.2 HadoopDB......Page 559
11.7.2.3 Estocada......Page 560
11.7.3 Hybrid Systems......Page 561
11.7.3.1 Spark SQL......Page 562
11.7.3.2 CloudMdsQL......Page 563
11.7.4 Concluding Remarks......Page 565
11.8 Conclusion......Page 566
11.9 Bibliographic Notes......Page 567
Exercises......Page 568
12 Web Data Management......Page 570
12.1 Web Graph Management......Page 571
12.2 Web Search......Page 573
12.2.1 Web Crawling......Page 574
12.2.2.2 Text Index......Page 577
12.2.3 Ranking and Link Analysis......Page 578
12.2.4 Evaluation of Keyword Search......Page 579
12.3 Web Querying......Page 580
12.3.1 Semistructured Data Approach......Page 581
12.3.2 Web Query Language Approach......Page 585
12.4 Question Answering Systems......Page 591
12.5 Searching and Querying the Hidden Web......Page 595
12.5.1.1 Querying the Search Interface......Page 596
12.5.2 Metasearching......Page 597
12.5.2.2 Database Categorization......Page 598
12.6 Web Data Integration......Page 599
12.6.1 Web Tables/Fusion Tables......Page 600
12.6.2 Semantic Web and Linked Open Data......Page 601
12.6.2.1 XML......Page 602
12.6.2.2 RDF......Page 606
12.6.2.3 Navigating and Querying the LOD......Page 618
12.6.3 Data Quality Issues in Web Data Integration......Page 619
12.6.3.1 Cleaning Structured Web Data......Page 620
12.6.3.2 Web Data Fusion......Page 621
12.6.3.3 Web Source Quality......Page 622
12.7 Bibliographic Notes......Page 626
Exercises......Page 629
A Overview of Relational DBMS......Page 630
B Centralized Query Processing......Page 631
C Transaction Processing Fundamentals......Page 632
D Review of Computer Networks......Page 633
References......Page 634
Index......Page 670
Recommend Papers

Principles of distributed database systems [4 ed.]
 9783030262525, 9783030262532

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

M. Tamer Özsu · Patrick Valduriez

Principles of Distributed Database Systems Fourth Edition

Principles of Distributed Database Systems

¨ M. Tamer Ozsu • Patrick Valduriez

Principles of Distributed Database Systems Fourth Edition

123

¨ M. Tamer Ozsu Cheriton School of Computer Science University of Waterloo Waterloo, ON, Canada

Patrick Valduriez Inria and LIRMM University of Montpellier Montpellier, France

The first two editions of this book were published by: Pearson Education, Inc.

ISBN 978-3-030-26252-5 ISBN 978-3-030-26253-2 (eBook) https://doi.org/10.1007/978-3-030-26253-2 3rd edition: © Springer Science+Business Media, LLC 2011 © Springer Nature Switzerland AG 2020 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG. The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

To our families and our parents M.T.Ö. and P.V.

Preface

The first edition of this book appeared in 1991 when the technology was new and there were not too many products. In the Preface to the first edition, we had quoted Michael Stonebraker who claimed in 1988 that in the following 10 years, centralized DBMSs would be an “antique curiosity” and most organizations would move towards distributed DBMSs. That prediction has certainly proved to be correct, and a large proportion of the systems in use today are either distributed or parallel— commonly referred to as scale-out systems. When we were putting together the first edition, undergraduate and graduate database courses were not as prevalent as they are now; so the initial version of the book contained lengthy discussions of centralized solutions before introducing their distributed/parallel counterparts. Times have certainly changed on that front as well, and now, it is hard to find a graduate student who does not have at least some rudimentary knowledge of database technology. Therefore, a graduate-level textbook on distributed/parallel database technology needs to be positioned differently today. That was our objective in this edition while maintaining the many new topics we introduced in the third edition. The main revisions introduced in this fourth edition are the following: 1. Over the years, the motivations and the environment for this technology have somewhat shifted (Web, cloud, etc.). In light of this, the introductory chapter needed a serious refresh. We revised the introduction with the aim of a more contemporary look at the technology. 2. We have added a new chapter on big data processing to cover distributed storage systems, data stream processing, MapReduce and Spark platforms, graph analytics, and data lakes. With the proliferation of these systems, systematic treatment of these topics is essential. 3. Similarly, we addressed the growing influence of NoSQL systems by devoting a new chapter to it. This chapter covers the four types of NoSQL (key-value stores, document stores, wide column systems, and graph DBMSs), as well as NewSQL systems and polystores. 4. We have combined the database integration and multidatabase query processing chapters from the third edition into a uniform chapter on database integration. vii

viii

Preface

5. We undertook a major revision of the web data management discussion that previously focused mostly on XML to refocus on RDF technology, which is more prevalent at this time. We now discuss, in this chapter, web data integration approaches, including the important issue of data quality. 6. We have revised and updated the peer-to-peer data management chapter and included a lengthy discussion of blockchain. 7. As part of our cleaning the previous chapters, we condensed the query processing and transaction management chapters by removing the fundamental centralized techniques and focused these chapters on distributed/parallel techniques. In the process, we included some topics that have since gained importance, such as dynamic query processing (eddies) and Paxos consensus algorithm and its use in commit protocols. 8. We updated the parallel DBMS chapter by clarifying the objectives, in particular, scale-up versus scale-out, and discussing parallel architectures that include UMA or NUMA. We also added a new section of parallel sorting algorithms and variants of parallel join algorithms to exploit large main memories and multicore processors that are prevalent today. 9. We updated the distribution design chapter by including a lengthy discussion of modern approaches that combine fragmentation and allocation. By rearranging material, this chapter is now central to data partitioning for both the distributed and parallel data management discussions in the remainder of the book. 10 Although object technology continues to play a role in information systems, its importance in distributed/parallel data management has declined. Therefore, we removed the chapter on object databases from this edition. As is evident, the entire book and every chapter have seen revisions and updates for a more contemporary treatment. The material we removed in the process is not lost—they are included as online appendices and appear on the book’s web page: https://cs.uwaterloo.ca/ddbs. We elected to make these available online rather than in the print version to keep the size of the book reasonable (which also keeps the price reasonable). The web site also includes presentation slides that can be used to teach from the book as well as solutions to most of the exercises (available only to instructors who have adopted the book for teaching). As in previous editions, many colleagues helped with this edition of the book whom we would like to thank (in no specific order). Dan Olteanu provided a nice discussion of two optimizations that can significantly reduce the maintenance time of materialized views in Chap. 3. Phil Bernstein provided leads for new papers on the multiversion transaction management that resulted in updates to that discussion in Chap. 5. Khuzaima Daudjee was also helpful in providing a list of more contemporary publications on distributed transaction processing that we include in the bibliographic notes section of that chapter. Ricardo JimenezPeris contributed text on high-performance transaction systems that is included in the same chapter. He also contributed a section on LeanXcale in the NoSQL, NewSQL, and polystores chapter. Dennis Shasha reviewed the new blockchain section in the P2P chapter. Michael Carey read the big data, NoSQL, NewSQL and

Preface

ix

polystores, and parallel DBMS chapters and provided extremely detailed comments that improved those chapters considerably. Tamer’s students Anil Pacaci, Khaled Ammar and postdoc Xiaofei Zhang provided extensive reviews of the big data chapter, and texts from their publications are included in this chapter. The NoSQL, NewSQL, and polystores chapter includes text from publications of Boyan Kolev and Patrick’s student Carlyna Bondiombouy. Jim Webber reviewed the section on Neo4j in that chapter. The characterization of graph analytics systems in that chapter is partially based on Minyang Han’s master’s thesis where he also proposes GiraphUC approach that is discussed in that chapter. Semih Salihoglu and Lukasz Golab also reviewed and provided very helpful comments on parts of this chapter. Alon Halevy provided comments on the WebTables discussion in Chap. 12. The data quality discussion in web data integration is contributed by Ihab Ilyas and Xu Chu. Stratos Idreos was very helpful in clarifying how database cracking can be used as a partitioning approach and provided text that is included in Chap. 2. Renan Souza and Fabian Stöter reviewed the entire book. The third edition of the book introduced a number of new topics that carried over to this edition, and a number of colleagues were very influential in writing those chapters. We would like to, once again, acknowledge their assistance since their impact is reflected in the current edition as well. Renée Miller, Erhard Rahm, and Alon Halevy were critical in putting together the discussion on database integration, which was reviewed thoroughly by Avigdor Gal. Matthias Jarke, Xiang Li, Gottfried Vossen, Erhard Rahm, and Andreas Thor contributed exercises to this chapter. Hubert Naacke contributed to the section on heterogeneous cost modeling and Fabio Porto to the section on adaptive query processing. Data replication (Chap. 6) could not have been written without the assistance of Gustavo Alonso and Bettina Kemme. Esther Pacitti also contributed to the data replication chapter, both by reviewing it and by providing background material; she also contributed to the section on replication in database clusters in the parallel DBMS chapter. Peer-to-peer data management owes a lot to the discussions with Beng Chin Ooi. The section of this chapter on query processing in P2P systems uses material from the PhD work of Reza Akbarinia and Wenceslao Palma, while the section on replication uses material from the PhD work of Vidal Martins. We thank our editor at Springer Susan Lagerstrom-Fife for pushing this project within Springer and also pushing us to finish it in a timely manner. We missed almost all of her deadlines, but we hope the end result is satisfactory. Finally, we would be very interested to hear your comments and suggestions regarding the material. We welcome any feedback, but we would particularly like to receive feedback on the following aspects: 1. Any errors that may have remained despite our best efforts (although we hope there are not many);

x

Preface

2. Any topics that should no longer be included and any topics that should be added or expanded; 3. Any exercises that you may have designed that you would like to be included in the book. Waterloo, Canada Montpellier, France June 2019

M. Tamer Özsu ([email protected]) Patrick Valduriez ([email protected])

Contents

1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 What Is a Distributed Database System? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 History of Distributed DBMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Data Delivery Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Promises of Distributed DBMSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.1 Transparent Management of Distributed and Replicated Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.2 Reliability Through Distributed Transactions. . . . . . . . . . . . 1.4.3 Improved Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.4 Scalability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.1 Distributed Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.2 Distributed Data Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.3 Distributed Query Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.4 Distributed Concurrency Control . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.5 Reliability of Distributed DBMS . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.6 Replication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.7 Parallel DBMSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.8 Database Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5.9 Alternative Distribution Approaches . . . . . . . . . . . . . . . . . . . . . 1.5.10 Big Data Processing and NoSQL . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Distributed DBMS Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6.1 Architectural Models for Distributed DBMSs . . . . . . . . . . . 1.6.2 Client/Server Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6.3 Peer-to-Peer Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6.4 Multidatabase Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6.5 Cloud Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 1 3 5 7 7 10 11 13 13 13 14 14 14 15 15 16 16 16 16 17 17 20 22 25 27 31

xi

xii

Contents

2

Distributed and Parallel Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Data Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Horizontal Fragmentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Vertical Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.3 Hybrid Fragmentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Auxiliary Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Allocation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Solution Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Combined Approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Workload-Agnostic Partitioning Techniques . . . . . . . . . . . . 2.3.2 Workload-Aware Partitioning Techniques . . . . . . . . . . . . . . . 2.4 Adaptive Approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Detecting Workload Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.2 Detecting Affected Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 Incremental Reconfiguration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 Data Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33 35 37 52 65 66 68 69 72 72 73 74 78 79 79 80 82 83 84

3

Distributed Data Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 View Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Views in Centralized DBMSs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Views in Distributed DBMSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.3 Maintenance of Materialized Views . . . . . . . . . . . . . . . . . . . . . . 3.2 Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Discretionary Access Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Mandatory Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Distributed Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Semantic Integrity Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Centralized Semantic Integrity Control . . . . . . . . . . . . . . . . . . 3.3.2 Distributed Semantic Integrity Control. . . . . . . . . . . . . . . . . . . 3.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

91 92 92 95 96 102 103 106 108 110 111 116 123 123

4

Distributed Query Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Query Processing Problem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.2 Query Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3 Layers Of Query Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Data Localization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Reduction for Primary Horizontal Fragmentation . . . . . . . 4.2.2 Reduction with Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.3 Reduction for Vertical Fragmentation . . . . . . . . . . . . . . . . . . . . 4.2.4 Reduction for Derived Fragmentation. . . . . . . . . . . . . . . . . . . . 4.2.5 Reduction for Hybrid Fragmentation. . . . . . . . . . . . . . . . . . . . .

129 130 130 133 136 140 141 142 143 145 148

Contents

4.3

xiii

Join Ordering in Distributed Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Join Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 Join Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Semijoin-Based Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4 Join Versus Semijoin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Distributed Cost Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Cost Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Database Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Distributed Query Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.1 Dynamic Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.2 Static Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.3 Hybrid Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adaptive Query Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.1 Adaptive Query Processing Process . . . . . . . . . . . . . . . . . . . . . . 4.6.2 Eddy Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

149 149 151 153 156 157 157 159 161 161 165 169 173 174 176 177 178

5

Distributed Transaction Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Background and Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Distributed Concurrency Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Locking-Based Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Timestamp-Based Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 Multiversion Concurrency Control . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 Optimistic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Distributed Concurrency Control Using Snapshot Isolation . . . . . . . 5.4 Distributed DBMS Reliability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Two-Phase Commit Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2 Variations of 2PC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.3 Dealing with Site Failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.4 Network Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5 Paxos Consensus Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.6 Architectural Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Modern Approaches to Scaling Out Transaction Management . . . . 5.5.1 Spanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2 LeanXcale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

183 184 188 189 197 203 205 206 209 211 217 220 227 231 234 236 237 237 239 241

6

Data Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 Consistency of Replicated Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Mutual Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.2 Mutual Consistency Versus Transaction Consistency . . . 6.2 Update Management Strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 Eager Update Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Lazy Update Propagation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

247 249 249 251 252 253 254

4.4

4.5

4.6

4.7 4.8

xiv

Contents

6.2.3 Centralized Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.4 Distributed Techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replication Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.1 Eager Centralized Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.2 Eager Distributed Protocols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.3 Lazy Centralized Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.4 Lazy Distributed Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Group Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replication and Failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.1 Failures and Lazy Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5.2 Failures and Eager Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

254 255 255 256 262 262 268 269 272 273 273 276 277

7

Database Integration—Multidatabase Systems . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Database Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 Bottom-Up Design Methodology . . . . . . . . . . . . . . . . . . . . . . . . 7.1.2 Schema Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.3 Schema Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.4 Schema Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.5 Data Cleaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Multidatabase Query Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 Issues in Multidatabase Query Processing . . . . . . . . . . . . . . . 7.2.2 Multidatabase Query Processing Architecture . . . . . . . . . . . 7.2.3 Query Rewriting Using Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.4 Query Optimization and Execution . . . . . . . . . . . . . . . . . . . . . . 7.2.5 Query Translation and Execution. . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

281 282 283 287 296 298 306 307 308 309 311 317 329 332 334

8

Parallel Database Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Objectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Parallel Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.1 General Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.2 Shared-Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.3 Shared-Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.4 Shared-Nothing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Data Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4 Parallel Query Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.4.1 Parallel Algorithms for Data Processing . . . . . . . . . . . . . . . . . 8.4.2 Parallel Query Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5 Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.1 Parallel Execution Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.2 Intraoperator Load Balancing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.3 Interoperator Load Balancing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5.4 Intraquery Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

349 350 352 353 355 357 358 359 362 362 369 374 374 376 378 378

6.3

6.4 6.5

6.6 6.7

Contents

8.6 8.7

xv

Fault-Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7.1 Database Cluster Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7.2 Replication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7.3 Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.7.4 Query Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

383 384 385 386 386 387 390 390

9

Peer-to-Peer Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.1 Unstructured P2P Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.2 Structured P2P Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.3 Superpeer P2P Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.4 Comparison of P2P Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Schema Mapping in P2P Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.1 Pairwise Schema Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.2 Mapping Based on Machine Learning Techniques . . . . . . 9.2.3 Common Agreement Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.4 Schema Mapping Using IR Techniques . . . . . . . . . . . . . . . . . . 9.3 Querying Over P2P Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3.1 Top-k Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3.2 Join Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.3.3 Range Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4 Replica Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4.1 Basic Support in DHTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4.2 Data Currency in DHTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4.3 Replica Reconciliation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5 Blockchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.1 Blockchain Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.2 Blockchain Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.3 Blockchain 2.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.4 Issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.7 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

395 398 399 402 406 408 408 408 409 410 411 411 412 424 425 428 429 431 432 436 437 438 442 443 444 445

10

Big Data Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 Distributed Storage Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.1 Google File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.2 Combining Object Storage and File Storage . . . . . . . . . . . . . 10.2 Big Data Processing Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2.1 MapReduce Data Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2.2 Data Processing Using Spark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 Stream Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3.1 Stream Models, Languages, and Operators . . . . . . . . . . . . . . 10.3.2 Query Processing over Data Streams. . . . . . . . . . . . . . . . . . . . . 10.3.3 DSS Fault-Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

449 451 453 454 455 456 466 470 472 476 483

8.8 8.9

xvi

Contents

10.4

Graph Analytics Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.1 Graph Partitioning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.2 MapReduce and Graph Analytics . . . . . . . . . . . . . . . . . . . . . . . . 10.4.3 Special-Purpose Graph Analytics Systems . . . . . . . . . . . . . . 10.4.4 Vertex-Centric Block Synchronous. . . . . . . . . . . . . . . . . . . . . . . 10.4.5 Vertex-Centric Asynchronous . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.6 Vertex-Centric Gather-Apply-Scatter . . . . . . . . . . . . . . . . . . . . 10.4.7 Partition-Centric Block Synchronous Processing. . . . . . . . 10.4.8 Partition-Centric Asynchronous . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.9 Partition-Centric Gather-Apply-Scatter . . . . . . . . . . . . . . . . . . 10.4.10 Edge-Centric Block Synchronous Processing . . . . . . . . . . . 10.4.11 Edge-Centric Asynchronous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.12 Edge-Centric Gather-Apply-Scatter . . . . . . . . . . . . . . . . . . . . . . Data Lakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.1 Data Lake Versus Data Warehouse . . . . . . . . . . . . . . . . . . . . . . . 10.5.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.3 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

486 489 494 495 498 501 503 504 506 506 507 507 507 508 508 510 511 512 512

NoSQL, NewSQL, and Polystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Motivations for NoSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Key-Value Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2.1 DynamoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2.2 Other Key-Value Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Document Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.1 MongoDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.2 Other Document Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4 Wide Column Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4.1 Bigtable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4.2 Other Wide Column Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5 Graph DBMSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5.1 Neo4j. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5.2 Other Graph Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6 Hybrid Data Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.1 Multimodel NoSQL Stores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.2 NewSQL DBMSs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7 Polystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7.1 Loosely Coupled Polystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7.2 Tightly Coupled Polystores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7.3 Hybrid Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7.4 Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.9 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

519 520 521 522 524 525 525 528 529 529 531 531 532 535 535 536 537 540 540 544 549 553 554 555

10.5

10.6 10.7 11

Contents

xvii

12

Web Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1 Web Graph Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2 Web Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2.1 Web Crawling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2.2 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2.3