Exact Positioning of Data Approach to Memory Mapped Persistent Stores: Design, Analysis and Modelling
Total Page:16
File Type:pdf, Size:1020Kb
Exact Positioning of Data Approach to Memory Mapped Persistent Stores: Design, Analysis and Modelling by Anil K. Goel A thesis presented to the University of Waterloo in fulfilment of the thesis requirement for the degree of Doctor of Philosophy in Computer Science Waterloo, Ontario, Canada, 1996 c Anil K. Goel 1996 I hereby declare that I am the sole author of this thesis. I authorize the University of Waterloo to lend this thesis to other institutions or indi- viduals for the purpose of scholarly research. I further authorize the University of Waterloo to reproduce this thesis by photocopy- ing or by other means, in total or in part, at the request of other institutions or individuals for the purpose of scholarly research. iii The University of Waterloo requires the signatures of all persons using or photocopy- ing this thesis. Please sign below, and give address and date. v Abstract One of the primary functions of computers is to store information, i.e., to deal with long lived or persistent data. Programmers working with persistent data structures are faced with the problem that there are two, mostly incompatible, views of structured data, namely data in primary and secondary storage. Traditionally, these two views of data have been dealt with independently by researchers in the programming language and database communities. Significant research has occurred over the last decade on efficient and easy-to-use methods for manipulating persistent data structures in a fashion that makes the sec- ondary storage transparent to the programmer. Merging primary and secondary storage in this manner produces a single-level store, which gives the illusion that data on sec- ondary storage is accessible in the same way as data in primary storage. In complex de- sign environments, a single-level store offers substantial performance advantages over conventional file or database access. These advantages are crucial to unconventional database applications such as computer-aided design, text management, and geograph- ical information systems. In addition, a single-level store reduces complexity in a pro- gram by freeing the programmer from the responsibility of dealing with two views of data. This dissertation proposes, develops and investigates a novel approach for imple- menting single-level stores using memory mapping. Memory mapping is the use of virtual memory to map data stored on secondary storage into primary storage so that the data is directly accessible by the processor's instructions. In this environment, all transfer of data to and from the secondary store takes place implicitly during program execution. The methodology was motivated by the significant simplification in expressing com- plex data structures offered by the technique of memory mapping. This work parallels vii other proposals that exploit the potential of memory mapping, but develops a unique approach based on the ideas of segmentation and exact positioning of data in memory. Rigorous experimentation has been conducted to demonstrate the effectiveness and ease of use of the proposed methodology vis-a-vis the traditional approaches of manipulating structured data on secondary storage. The behaviour of high-level database algorithms in the proposed memory mapped environment, especially in highly parallel systems, has been investigated. A quantitative analytical model of computation in this environment has been designed and validated through experiments conducted on several database join algorithms; parallel multi-disk versions of the traditional join algorithms were developed for this purpose. An analytical model of the system is extremely useful for data structure and algorithm designers for predicting general performance behaviour without having to construct and test specific algorithms. More importantly, a quantitative model is an essential tool for database subsystems such as a query optimizer. viii Acknowledgements The production of this dissertation would have been so much harder, if not impossi- ble, without the guidance, encouragement, mentoring, unbounded patience, hard work, friendship and generosity of my supervisor Dr. Peter Buhr. I thank Peter for everything he has done for me since my arrival at Waterloo. I am grateful to Dr. Prabhakar Ragde and Dr. Naomi Nishimura for co-supervising the theoretical aspects of this dissertation. Their contribution was instrumental in mak- ing this dissertation into a reality. I thank my wife Aparna, daughter Ankita and son Anirudh, who have all contributed to the dissertation in more ways than one. They provided the flicker of light during the darkest hours and ensured that I did not get lost somewhere along the way. I thank my external examiner, Dr. John Rosenberg of the University of Sydney, Aus- tralia and the other members of my examining committee, Dr. Paul Larson, Dr. Frank Tompa and Dr. Bruno Preiss for their valuable suggestions. Dr. Paul Larson, Dr. Bernhard Seeger, Andy Wai and David Clark provided valuable help during the early experiments. Dr. Ian Munro was always willing to discuss matters of theory. Several other people, in particular, N. Asokan, Gopi Attaluri, Lauri Brown and Glenn Paulley, offered suggestions and encouragement that was instrumental in preserving my senility and I am thankful to all of them. I am thankful to the Math Faculty Computing Facility at the University of Waterloo for maintaining a top notch computing environment and for employing me during the last three years of my stay at UW. MFCF and the wonderful people that work there certainly made my life much easier. In particular, I thank Bill Ince for never saying no. Finally, I thank all the people I have interacted with at Waterloo for making my stay here most enjoyable. ix To Aparna xi Contents 1 Introduction 1 1.1 The Single-Level Store . 2 1.2 Exact Positioning of Data Approach to Memory Mapping . 4 1.2.1 EPD Approach . 6 1.2.2 Multiple Accessible Databases and Inter-Database Pointers . 7 1.2.3 EPD Persistence Model . 10 1.3 Motivation . 12 1.4 The Thesis . 13 1.4.1 Dissertation Overview . 15 2 Memory Mapping and Single-Level Stores 19 2.1 Motivation for Using Memory Mapping . 20 2.2 Memory Mapping and the EPD Approach . 23 2.2.1 Non-Uniform Access Speed . 25 2.2.2 Advantages . 25 2.2.3 Disadvantages . 31 2.3 Survey of Related Work . 32 2.3.1 Software Approaches Based on Conventional Architectures . 32 xiii PS-Algol / POMS . 33 Napier / Brown's Stable Store . 35 E / EXODUS Storage Manager . 36 Other Language Efforts . 37 Texas: Pointer Swizzling at Page Fault Time . 37 Hybrid Pointer Swizzling . 39 ObjectStore . 40 Cricket . 42 QuickStore . 42 2.3.2 Architectural Approaches . 44 Bubba Database System . 44 MONADS Architecture . 45 Model for Address-Oriented Software . 45 Single Address Space Operating Systems (SASOSs) . 46 Grasshopper Operating System . 48 IBM RS 6000 and AS/400 . 49 Recoverable Virtual Memory . 49 Camelot Distributed Transaction System . 49 IBM's 801 prototype hardware architecture . 50 Clouds Distributed Operating System . 50 2.3.3 Others . 50 2.4 Summary . 51 3 Using the EPD Approach to Build a Single-Level Store 53 3.1 Database Design Methodology . 53 3.1.1 Design Objectives . 54 xiv 3.1.2 Basic Structure . 57 3.1.3 Representative . 58 3.1.4 Accessors . 62 3.1.5 Critique of Database . 64 3.2 Comparison of Database with Related Approaches . 65 3.3 Parallelism in Database . 69 3.3.1 Partitioned File Structures and Concurrent Retrievals . 71 3.3.2 Query Types and Parallelism . 72 3.3.3 Range Query Generators or Iterators . 73 3.3.4 Generic Concurrent Retrieval Algorithm . 74 3.4 Programming Issues and Interfaces . 78 3.4.1 Polymorphism . 78 3.4.2 Generic File Structures and Access Methods . 79 3.4.3 Storage Management . 80 Memory Organization . 81 3.4.4 Nested Memory Structure . 83 3.4.5 Address Space Tools . 83 3.4.6 Segment Tools . 84 3.4.7 Database Programming Interface . 85 3.4.8 Representative Interface . 86 Class Rep . 86 Class RepAccess . 87 Organization of Representative and Access Classes . 89 Class RepWrapper . 91 3.4.9 Heap Tools . 92 Storage Management Schemes . 93 xv Nesting Heaps . 94 Overflow Control . 95 Expansion Object . 96 3.4.10 Linked List Example . 99 List Application . 99 3.4.11 Linked List File Structure . 101 List Node . 101 Administration . 102 Expansion Class . 103 File Structure Class . 104 Access Class . 107 Generator . 107 Wrapper . 109 3.4.12 Programming Conventions . 111 3.4.13 B-Tree Example . 112 B-Tree Application . 113 Nested Memory Manager . 114 3.5 Analytical Modelling of the System . 119 3.5.1 Survey of Related Work . 120 Theoretical Models . 120 Database Studies . 122 3.5.2 Modelling . 124 Disk Transfer Time . 127 Memory Mapping Costs . 128 3.5.3 Using the Model to Analyze an Algorithm . 130 3.6 Summary . ..