The Modified Object Buffer: A Storage Management Technique for Object-Oriented Databases
by
Sanjay Ghemawat
S.B., Cornell University (1987)
S.M. Massachusetts Institute of Technology (1990)
Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of
Doctor of Philosophy at the
MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 1995
c
Massachusetts Institute of Technology 1995. All rights reserved.
Author::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Department of Electrical Engineering and Computer Science
September 7, 1995
Certified by::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Barbara H. Liskov NEC Professor of Software Science and Engineering Thesis Supervisor
Certified by::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: M. Frans Kaashoek Jamieson Career Development Assistant Professor of Computer Science and Engineering Thesis Supervisor
Accepted by:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Frederic R. Morgenthaler Chairman, Departmental Committee on Graduate Students
The Modified Object Buffer: A Storage Management Technique for Object-Oriented Databases
by
Sanjay Ghemawat
Submitted to the Department of Electrical Engineering and Computer Science on September 7, 1995, in partial fulfillment of the
requirements for the degree of Doctor of Philosophy Abstract
Object-oriented databases store many small objects on disks. Disks perform poorly when reading and writing individual small objects. This thesis presents a new storage management architecture that substantially improves disk performance of a distributed object-oriented database system. The storage architecture is built around a large modified object buffer (MOB) that is stored in primary memory.
The MOB provides volatile storage for modified objects. Modified objects are placed in the MOB instead of being immediately written out to disk. Modifications are written to disk lazily as the MOB fills up and space is required for new modifications. The MOB improves performance because even if an object is modified many times in a short period of time, the object has to be written out to disk only once. Furthermore, by the time an object modification has to be flushed from the MOB, many modifications to other objects on the same page may have accumulated. All of these modifications can be written to disk with a single disk write.
This thesis evaluates the modified object buffer in combination with a number of disk layout policies that make different tradeoffs between read performance and write performance. The MOB has been implemented as part of the Thor object-oriented database. Results from simulations and from this implementation show that the MOB improves the performance of a read-optimized disk layout that preserves clustering by over 200%. As a result, the read-optimized disk layout consistently out-performs a write-optimized disk layout that does not preserve clustering. The read- optimized disk layout provides better overall performance on a wide range of workloads, including workloads that write a lot of data. Performance results also show that for typical object-oriented database access patterns, the modified object buffer architecture out-performs the traditional page based organization of server memory used in many databases and file systems.
Keywords: modified object buffer, object-oriented databases, disks, clustering, write buffers, write absorption, read-optimized, write-optimized, disk layout, installation reads
Thesis Supervisor: Barbara H. Liskov
Title: NEC Professor of Software Science and Engineering Thesis Supervisor: M. Frans Kaashoek
Title: Jamieson Career Development Assistant Professor of Computer Science and Engineering
Acknowledgments
I thank my research supervisors Barbara Liskov and Frans Kaashoek for supporting and guiding this thesis. I am also grateful to Butler Lampson for being a careful and meticulous reader and for pointing out the importance of simple analytical models. Barbara, Frans, and Butler all greatly strengthened my thesis by providing constructive criticism and feedback.
Bob Gruber has been a good friend and wonderful colleague. Frequent discussions with him have had a significant impact on this thesis. Liuba Shrira and Jim O’Toole deserve a lot of credit for pointing out the performance benefits of delaying installation reads. Atul Adya’s hard work on automated testing for Thor saved me a lot of time during the last few critical months of my work on this thesis. I am also indebted to the other members of the programming methodology group (Eui-Suk, Debbie, Quinton, Phil, Tony, Umesh, Miguel, Andrew, Mark, Dorothy, and Paul among others) for providing an excellent research environment and a friendly and relaxed work atmosphere.
Other members of the lab have also contributed to make the lab a pleasant environment.
Wilson Hsieh, Anthony Joseph, and Carl Waldspurger have been here since almost from the very start. Wilson in particular has been good for countless hours of thesis avoidance. Parry Husbands has been a storehouse of mathematical knowledge. Discussions with Eric Brewer over morning capuccinos got me in the right frame of mind to start many work days. I also appreciate the can of soup from a donor who shall remain nameless.
I thank all of my volleyball teammates from the Vile Servers and the M.I.T. club team. In particular Gunter, Koji, Amy, Phil, Darcy, and Parry have been good friends and wonderful dinner companions.
Finally, I thank all of the members of my family for their love and support, and for not asking me when I was going to graduate too often.
This research was supported in part by the Advanced Research Projects Agency of the Department of Defense, monitored by the Office of Naval Research under contract N00014-91-J-4136, in part by the National Science Foundation under Grant CCR-8822158, and by an equipment grant from Digital Equipment Corporation.
Contents
1 Introduction 15
1.1 Background : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 16 1.1.1 Transactions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 17 1.1.2 Distributed Operation : : : : : : : : : : : : : : : : : : : : : : : : : 17 1.2 Storage Management Options : : : : : : : : : : : : : : : : : : : : : : : : : 18 1.3 Results : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 20 1.3.1 Object-Shipping Systems : : : : : : : : : : : : : : : : : : : : : : : 21 1.3.2 Page-Shipping Systems : : : : : : : : : : : : : : : : : : : : : : : : 22 1.4 Overview: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 23
2 System Architecture 25
2.1 System Interface : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 25 2.2 Distributed Operation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 26 2.3 Transactions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 26 2.4 Client Operation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 27 2.5 Client–Server Protocol : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 28 2.6 Stable Transaction Log: : : : : : : : : : : : : : : : : : : : : : : : : : : : : 29 2.7 Pages: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 30 2.8 Object Location : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 31 2.9 Server Organization : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 32
3 Storage Management Policies 35
3.1 Modified Object Buffer : : : : : : : : : : : : : : : : : : : : : : : : : : : : 35 3.1.1 Object Modifications: : : : : : : : : : : : : : : : : : : : : : : : : : 35 3.1.2 Object Fetches : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 36 3.1.3 MOB Interface : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 36 3.1.4 MOB Implementation : : : : : : : : : : : : : : : : : : : : : : : : : 38 3.1.5 Discussion : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 39 3.2 Disk Layout Policies : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 40 3.2.1 Read-Optimized Disk Layout : : : : : : : : : : : : : : : : : : : : : 40 3.2.2 Write-Optimized Disk Layout : : : : : : : : : : : : : : : : : : : : : 44 3.2.3 Hybrid Disk Layout : : : : : : : : : : : : : : : : : : : : : : : : : : 47 3.2.4 Discussion : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 47
4 Disk Layout Policies 49 4.1 Workload: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 50 4.1.1 Clustering : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 51 4.1.2 Skewed Access Pattern : : : : : : : : : : : : : : : : : : : : : : : : 53 4.2 Simulator Components : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 54 4.2.1 Clients : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 54 4.2.2 Network : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 55 4.2.3 Disk : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 55 4.2.4 Server : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 56 4.2.5 Disk Cleaning : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 57 4.3 Results : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 57 4.3.1 MOB Size : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 58 4.3.2 Write Absorption Analysis: : : : : : : : : : : : : : : : : : : : : : : 58 4.3.3 Read Performance : : : : : : : : : : : : : : : : : : : : : : : : : : : 64 4.3.4 Read Performance Analysis : : : : : : : : : : : : : : : : : : : : : : 65 4.3.5 Memory Allocation : : : : : : : : : : : : : : : : : : : : : : : : : : 67 4.3.6 Write Probabilities : : : : : : : : : : : : : : : : : : : : : : : : : : : 68 4.3.7 Clustering : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 68 4.3.8 Locality of Access : : : : : : : : : : : : : : : : : : : : : : : : : : : 71 4.3.9 Client Cache Size : : : : : : : : : : : : : : : : : : : : : : : : : : : 71 4.3.10 Page Size : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 72 4.3.11 Database Size : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 74 4.3.12 Object Size : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 75 4.3.13 Hybrid Policy : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 76 4.4 Summary: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 77
5 Page-Shipping Systems 79
5.1 PAGE Simulation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 80 5.2 MOB Simulation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 81 5.3 Results : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 81 5.3.1 Clustering Density : : : : : : : : : : : : : : : : : : : : : : : : : : : 83 5.3.2 Write Probability : : : : : : : : : : : : : : : : : : : : : : : : : : : 83 5.4 Discussion : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 85
6 Implementation 87
6.1 Client Implementation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 87 6.1.1 Object Layout and Access : : : : : : : : : : : : : : : : : : : : : : : 88 6.1.2 Cache Management : : : : : : : : : : : : : : : : : : : : : : : : : : 89 6.1.3 Transaction Management : : : : : : : : : : : : : : : : : : : : : : : 89 6.1.4 Object Creation : : : : : : : : : : : : : : : : : : : : : : : : : : : : 90 6.2 Server Implementation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 90 6.2.1 Fetch Requests : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 90 6.2.2 Object Location Information : : : : : : : : : : : : : : : : : : : : : : 91 6.2.3 Transaction Commits : : : : : : : : : : : : : : : : : : : : : : : : : 92
8