Performance Evaluation of Java Object-Relational Mapping Tools
Total Page:16
File Type:pdf, Size:1020Kb
PERFORMANCE EVALUATION OF JAVA OBJECT-RELATIONAL MAPPING TOOLS by HASEEB YOUSAF (Under the Direction of John A. Miller) ABSTRACT In the modern era of enterprise Web technology, there is strong competition growing between different vendors for highly scalable and reliable Web application frameworks. In designing these Web applications, the companies need some storage mechanism through which they manipulate the data efficiently. The traditional database management systems provide this functionality but require a complete knowledge of the SQL. Nowadays, there are many Object- Relational Mapping (ORM) persistent stores available, which make the application developer job easier by providing the same functionality as that of a traditional database. The Java language also provides ORM tools such as Hibernate, EclipseLink that provide the same functionality. Similarly, we have created a lightweight persistent tool named GlycoVault, which provides similar functionality. This study is focused on comparing different Java ORM tools including GlycoVault. The study provides information about the tools’ functionalities and also compares the results of several queries we have designed to test their performance. INDEX WORDS: Persistent, ORM, Hibernate, GlycoVault, Ebean, EclipseLink, OpenJPA, database, SQL, cache, performance. PERFORMANCE EVALUATION OF JAVA OBJECT-RELATIONAL MAPPING TOOLS by HASEEB YOUSAF BS, Iqra University, Pakistan, 2005 MBA, Iqra University, Pakistan, 2007 A Thesis Submitted to the Graduate Faculty of The University of Georgia in Partial Fulfillment of the Requirements for the Degree MASTER OF SCIENCE ATHENS, GEORGIA 2012 © 2012 Haseeb Yousaf All Rights Reserved PERFORMANCE EVALUATION OF JAVA OBJECT-RELATIONAL MAPPING TOOLS by HASEEB YOUSAF Major Professor: John A. Miller Committee: Krzysztof J. Kochut William S. York Electronic Version Approved: Maureen Grasso Dean of the Graduate School The University of Georgia May 2012 DEDICATION To my family and friends iv ACKNOWLEDGEMENTS I would like to thank my major professor Dr. John A. Miller for helping me throughout the Masters program in increasing my knowledge and help me in completing my thesis. I would also like to thank Dr. Kochut, for his support throughout the completion of this project and providing me the suggestions and valuable ideas. I would like to say thanks to Dr. William York for giving me useful knowledge about GlycoVault and related scientific background. I would also like to thank Matthew Everson for providing me guidance in the GlycoVault source code. I would also like to thank my lab mates including Khalifeh-al-Jaddah and Ki Tae Myoung for giving me the initiative to start this research. I also want to thank my friends and family to support me during the whole masters program. v TABLE OF CONTENTS Page ACKNOWLEDGEMENTS.............................................................................................................v CHAPTER 1 INTRODUCTION .........................................................................................................1 2 RELATED WORK ........................................................................................................3 2.1 ORM vs. ObjectDB............................................................................................3 2.2 Java Persistent Store Comparison......................................................................4 2.3 Object Store Comparison...................................................................................5 2.4 JPA vs. JDO.......................................................................................................6 2.5 Hibernate vs. IBatis............................................................................................7 3 OBJECT-RELATIONAL MAPPING ...........................................................................9 3.1 ORM Paradigm Mismatch Problems...............................................................10 3.2 Entity Mapping ................................................................................................12 3.3 Inheritance Mapping ........................................................................................12 3.4 Navigation Mapping ........................................................................................16 3.5 Association Mapping .......................................................................................16 4 PERSISTENT STORAGE MANAGERS ...................................................................20 4.1 JPA...................................................................................................................20 4.2 Hibernate..........................................................................................................23 4.3 OpenJPA ..........................................................................................................23 vi 4.4 EclipseLink ......................................................................................................23 4.5 Ebean................................................................................................................24 4.6 GlycoVault.......................................................................................................24 5 QUERY LANGUAGES ..............................................................................................27 5.1 JPQL ................................................................................................................27 5.2 HQL .................................................................................................................29 5.3 Ebean Query Language....................................................................................29 5.4 GlycoVault Querying.......................................................................................30 6 TRANSACTION MANAGEMENT ...........................................................................31 6.1 Transaction.......................................................................................................31 6.2 Transaction Demarcation.................................................................................31 6.3 Transaction Models..........................................................................................32 7 CACHE MANAGEMENT ..........................................................................................35 7.1 First-Level Cache.............................................................................................35 7.2 Second-Level Cache ........................................................................................37 7.3 Query Cache.....................................................................................................37 7.4 Cache Comparison...........................................................................................37 8 PERFORMANCE COMPARISON.............................................................................43 8.1 Domain Model .................................................................................................43 8.2 Evaluation Setup ..............................................................................................44 8.3 Test Queries .....................................................................................................44 8.4 Evaluation Criteria...........................................................................................45 8.5 Comparison Results .........................................................................................46 vii 9 CONCLUSIONS AND FUTURE WORK ..................................................................58 9.1 Conclusions......................................................................................................58 9.2 Future Work.....................................................................................................59 REFERENCES ..............................................................................................................................61 APPENDICES A Installation Guide.........................................................................................................64 B User Guide ...................................................................................................................66 C Developer’s Guide .......................................................................................................68 D Test Queries and Results..............................................................................................73 E Population of Glycomics Data....................................................................................104 F Example of Object Relational Mapping in Hibernate................................................108 viii CHAPTER 1 INTRODUCTION Most of the enterprise level applications deal with huge amounts of data. These data are presented in different formats such as XML (Xtensible Markup Language), spreadsheets and text files. This data needs to be stored or retrieved in some fashion. In object-oriented programming, these data are in the form of objects. The storage of these objects is termed as persisting the objects. Persistent can be defined as, “The characteristics of data that outlives the execution of the program that created it.” [22] Object Persistence is defined as the storage of the objects after the execution of the program. An object-oriented language such as Java provides different persistence storage systems that provide mechanisms for persisting the data. Some of the commonly used