A Performance Analysis of Different Types of Databases.Docx

Total Page:16

File Type:pdf, Size:1020Kb

A Performance Analysis of Different Types of Databases.Docx nr ik v H e d a ap a l sk M a PERFORMANCE ANALYSIS OF RELATIONAL DATABASES, OBJECT-ORIENTED DATABASES AND ORM FRAMEWORKS PRESTANDAANALYS AV RELATIONSDATABASER, OBJEKTORIENTERADE DATABASER OCH ORM-RAMVERK Bachelor Degree Project in Computer Science 30 ECTS Spring term 2014 Victor Nagy Supervisor: Henrik Gustavsson Examiner: Göran Falkman Abstract In the planning stage of web and software development, it is important to select the right tool for the job. When selecting the database to use, relational databases like MySQL is a popular choice. However, relational databases suffer by object-relational impedance mismatch. In this work we will explore the response time of relational and object-oriented databases and the overhead of ORM frameworks. This will be done by creating a web application that receives data about flights and airports from a client, which measures the response time of the databases and the entire request. It was found that MySQL has the lowest response time, while the ORM framework Hibernate adds an overhead on some of the tests while performing similar to MySQL. Db4o had the highest response time in a majority of the tests. In future works, this study could be extended by other tests or by other type of databases. Keywords: database, relational database, object-oriented database, ORM framework, web Table of contents Table of contents................................................................................................................................................ 3 1 Introduction.....................................................................................................................................................1 2 Background..................................................................................................................................................... 2 2.1 Object-oriented programming and persistent data in web applications..............................................2 2.1.1 Java............................................................................................................................................2 2.2 Databases............................................................................................................................................. 2 2.2.1 Relational databases..................................................................................................................2 2.2.2 Object-oriented databases.........................................................................................................3 2.3 Object-Relational Mapping (ORM).....................................................................................................4 2.3.1 Hibernate...................................................................................................................................7 3 Problem........................................................................................................................................................... 8 3.1 Hypothesis............................................................................................................................................9 4 Method.......................................................................................................................................................... 10 4.1 Disadvantages with the method.........................................................................................................10 4.2 Evaluation.......................................................................................................................................... 11 4.3 Research ethics...................................................................................................................................11 5 Implementation...........................................................................................................................................13 5.1 Literature study.................................................................................................................................. 13 5.2 Frameworks, tools and libraries.........................................................................................................14 5.2.1 Play Framework......................................................................................................................14 5.2.2 MySQL................................................................................................................................... 15 5.2.3 Hibernate.................................................................................................................................17 5.2.4 db4o.........................................................................................................................................20 5.3 Development......................................................................................................................................21 5.3.1 Server...................................................................................................................................... 21 5.3.2 Client.......................................................................................................................................26 5.3.3 Client version 2.......................................................................................................................26 5.3.4 Conclusion.............................................................................................................................. 27 5.4 Pilot study.......................................................................................................................................... 27 5.4.1 Relational - Inserting airports.................................................................................................27 5.4.2 Relational - Inserting flights...................................................................................................28 5.4.3 Relational - Searching flights................................................................................................. 29 5.4.4 Relational - Listing all incoming flights to an airport............................................................30 6 Evaulation..................................................................................................................................................... 31 6.1 The Study........................................................................................................................................... 31 6.1.1 Summary.................................................................................................................................61 6.2 Analysis..............................................................................................................................................62 6.3 Conclusion......................................................................................................................................... 64 7 Concluding Remarks.....................................................................................................................................65 7.1 Summary............................................................................................................................................ 65 7.2 Discussion..........................................................................................................................................65 7.3 Future work........................................................................................................................................66 1 Introduction In many applications and websites there is a large need for persistence (Schahczenski, 2000). Persistence is the ability to save data between different executions of an application and between requests of a website. For example, a forum system needs to be able to save the posts the users make in case the information stored in memory is lost or the server is shut down (Kienzle and Romanovsky, 2002). A way to ensure data persistency for an application is to use database software to save data (Liu et al., 2008). Large websites and applications that need to do a lot of data operations rely on the overall system to keep working even under high load. One bottleneck for the application is the database overhead incurred when inserting and retrieving data. This is defined as server-side latency (Ghosh and Rau-Chaplin, 2006). On one hand one might need short response times when it comes from a database, on the other hand, there is development time and effort that might lead you to pick a database that is easier to develop code for. Relational databases are currently very popular (Bazghandi, 2006) but they are affected by the object-relational impedance mismatch (van Zyl et al., 2006). To solve that issue one could use an object-relational mapping (ORM) system or an object-oriented database. However, it might affect performance depending on the task. In this work we will compare the MySQL relational database to the db4o object-oriented database and the Hibernate ORM framework to evaluate the time taken to do inserts to the database and how long it takes to search the database. To do the comparison between the databases, a web application was developed. The web application uses the Play Java framework as a web framework and web server. The web application implements methods to insert and retrieve data from the MySQL relational database, from the db4o object database and to insert and retrieve data using the Hibernate
Recommended publications
  • Automatically Detecting ORM Performance Anti-Patterns on C# Applications Tuba Kaya Master's Thesis 23–09-2015
    Automatically Detecting ORM Performance Anti-Patterns on C# Applications Tuba Kaya Master's Thesis 23–09-2015 Master Software Engineering University of Amsterdam Supervisors: Dr. Raphael Poss (UvA), Dr. Giuseppe Procaccianti (VU), Prof. Dr. Patricia Lago (VU), Dr. Vadim Zaytsev (UvA) i Abstract In today’s world, Object Orientation is adopted for application development, while Relational Database Management Systems (RDBMS) are used as default on the database layer. Unlike the applications, RDBMSs are not object oriented. Object Relational Mapping (ORM) tools have been used extensively in the field to address object-relational impedance mismatch problem between these object oriented applications and relational databases. There is a strong belief in the industry and a few empirical studies which suggest that ORM tools can cause decreases in application performance. In this thesis project ORM performance anti-patterns for C# applications are listed. This list has not been provided by any other study before. Next to that, a design for an ORM tool agnostic framework to automatically detect these anti-patterns on C# applications is presented. An application is developed according to the designed framework. With its implementation of analysis on syntactic and semantic information of C# applications, this application provides a foundation for researchers wishing to work further in this area. ii Acknowledgement I would like to express my gratitude to my supervisor Dr. Raphael Poss for his excellent support through the learning process of this master thesis. Also, I like to thank Dr. Giuseppe Procaccianti and Prof. Patricia Lago for their excellent supervision and for providing me access to the Green Lab at Vrije Universiteit Amsterdam.
    [Show full text]
  • Hibernate ORM Query Simplication Using Hibernate
    2016 3rd National Foundation for Science and Technology Development Conference on Information and Computer Science Hibernate ORM Query Simplication Using Hibernate Criteria Extension (HCE) Kisman Sani M. Isa Master of Information Technology Master in Computer Science Bina Nusantara University Bina Nusantara University Jl. Kebon Jeruk Raya No. 27, Jakarta Barat, DKI Jl. Kebon Jeruk Raya No. 27, Jakarta Barat, DKI Jakarta, Indonesia 11530 Jakarta, Indonesia 11530 [email protected] [email protected] Abstract— Software development time is a critical issue interfaced by a query. The software engineer will make in software development process, hibernate has been the query specified to database used. Each database widely used to increase development speed. It is used in vendor has their Structured Query Language (SQL). As database manipulation layer. This research develops a the development of software technology and most of library to simplify hibernate criteria. The library that is programming languages are object oriented, some called as Hibernate Criteria Extension (HCE) provides API functions to simplify code and easily to be used. Query engineer or software institutions try to simplify the associations can be defined by using dot. The library will query process. They try to bind object in application to automatically detect the join association(s) based on database. This approach is called as Object Relational mapping in entity class. It can also be used in restriction Mapping (ORM). ORM is a translation mechanism from and order. HCE is a hibernate wrapper library. The object to relational data, vice versa. ORM has “dialect” configuration is based on hibernate configuration.
    [Show full text]
  • 2019 Stateof the Software Supply Chain
    2019 State of the Software Supply Chain The 5th annual report on global open source software development presented by in partnership with supported by Table of Contents Introduction................................................................................. 3 CHAPTER 4: Exemplary Dev Teams .................................26 4.1 The Enterprise Continues to Accelerate ...........................27 Infographic .................................................................................. 4 4.2 Analysis of 12,000 Large Enterprises ................................27 CHAPTER 1: Global Supply of Open Source .................5 4.3 Component Releases Make Up 85% of a Modern Application......................................... 28 1.1 Supply of Open Source is Massive ...........................................6 4.4 Characteristics of Exemplary 1.2 Supply of Open Source is Expanding Rapidly ..................7 Development Teams ................................................................... 29 1.3 Suppliers, Components and Releases ..................................7 4.5 Rewards for Exemplary Development Teams ..............34 CHAPTER 2: Global Demand for Open Source ..........8 CHAPTER 5: The Changing Landscape .......................35 2.1 Accelerating Demand for 5.1 Deming Emphasizes Building Quality In ...........................36 Open Source Libraries .....................................................................9 5.2 Tracing Vulnerable Component Release 2.2 Automated Pipelines and Downloads Across Software Supply Chains
    [Show full text]
  • Anembeddedquerylanguage in Scala
    Master Thesis An Embedded Query Language in Scala Amir Shaikhha Professor Martin Odersky Supervisors Vojin Jovanovic, Eugene Burmako Expert Stefan Zeiger, Typesafe Semester Spring 2013 An Embedded Query Language in Scala, p. 1 Abstract In this thesis we address the problem of integrating general purpose programming languages with relational databases. An approach to solving this problem is using raw strings to represent SQL statements. This approach leads to run-time errors and security vulnerabilities like SQL injection. The second approach is integrating the query in a host language. The most well-known example of the second approach is LINQ. This approach provides static checking of types and syntax during compilation. This thesis presents an embedded query language in Scala, namely Shadow Embedding in Slick. Shadow Embedding provides even stronger compile-time guarantees than LINQ and similar sys- tems in Scala. The experimental results show that the performance of our approach is very similar to the case of using raw Strings, thanks to static code analysis and clever code caching. An Embedded Query Language in Scala, p. 2 Acknowledgement First, I would like to thank Prof. Martin Odersky for giving me the opportunity to do my master thesis in Typesafe and LAMP. Vojin Jovanovic helped me tremendously during the whole period of my thesis. Thank you to Stefan Zeiger for believing in me and providing me with the opportunity to work on the Slick project. I would like to thank Eugene Burmako for all his support, Christopher Vogt for the great discussions, and everybody at Typesafe and the LAMP team. I can never thank my parents enough for believing in me and supporting me through all periods of my life.
    [Show full text]
  • Experimental Algorithmics from Algorithm Desig
    Lecture Notes in Computer Science 2547 Edited by G. Goos, J. Hartmanis, and J. van Leeuwen 3 Berlin Heidelberg New York Barcelona Hong Kong London Milan Paris Tokyo Rudolf Fleischer Bernard Moret Erik Meineche Schmidt (Eds.) Experimental Algorithmics From Algorithm Design to Robust and Efficient Software 13 Volume Editors Rudolf Fleischer Hong Kong University of Science and Technology Department of Computer Science Clear Water Bay, Kowloon, Hong Kong E-mail: [email protected] Bernard Moret University of New Mexico, Department of Computer Science Farris Engineering Bldg, Albuquerque, NM 87131-1386, USA E-mail: [email protected] Erik Meineche Schmidt University of Aarhus, Department of Computer Science Bld. 540, Ny Munkegade, 8000 Aarhus C, Denmark E-mail: [email protected] Cataloging-in-Publication Data applied for A catalog record for this book is available from the Library of Congress. Bibliographic information published by Die Deutsche Bibliothek Die Deutsche Bibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data is available in the Internet at <http://dnb.ddb.de> CR Subject Classification (1998): F.2.1-2, E.1, G.1-2 ISSN 0302-9743 ISBN 3-540-00346-0 Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer-Verlag.
    [Show full text]
  • Curriculum Vitae: Tom Eugelink
    Curriculum Vitae: Tom Eugelink Personalia Woonplaats Aalten Geboortedatum 25 juni 1970 Functie Senior software engineer / solution architect Email [email protected] Telefoon +31-647938592 Blog http://tbeernot.wordpress.com Hobbies Basketbal, Stijldansen, Sportschool, Gaming Talen Nederlands vloeiend (moedertaal), Engels en Duits vloeiend Opleiding Opleidingen VWO (CSA Aalten, 1989) Hogere Informatica (HIO Enschede, 1993, cum laude) Cursus hoger management TOGAF & archimate certified architect Boeken Patterns, Principles and Practices of DDD, Functional and Reactive Domain Modeling, Implementing Domain Driven Design, Building modular cloud apps with OSGi, Risk Driven Software Architecture, Effective Unit Testing, Spring 3 in Practice, Gradle in Action, UML distilled, The Cucumber for Java book Werkverleden Mei 1994 – Aug 2002 OVSoftware (developer) Sept 2002 – Oct 2005 Knowledgeplaza B.V. (senior software engineer) Nov 2005 – heden SoftWorks B.V. (senior software engineer / architect) Over Mijn eerste computerprogramma schreef ik in 1983 op een NewBrain, een veredelde broodtrommel met zo’n lang nagloeiend groen scherm. Maar die eerste keer was een bijna magische ervaring. Computers waren toen nog zeldzaam, maar op dat moment werd duidelijk wat ik later zou worden en dat maakte veel keuzes makkelijker. Behalve die tussen HBO en universiteit, in 1989 was de IT anders dan nu; de universiteit was vooral bezig met de wetenschappelijke en wiskundige kant, maar ik wilde juist software maken die mensen ondersteunde in hun dagelijkse leven. En daar sloot het HBO beter bij aan. Die insteek is tegenwoordig belangrijker dan ooit; software is nu overal, maar wordt nog steeds gemaakt voor mensen, maar vooral ook door mensen. En met alle technische keuzes en mogelijkheden die je als ontwikkelaar of architect hebt, is ‘the human factor’ vaak veel bepalender.
    [Show full text]
  • A Test Suite Generator for Struts Based Applications Gregory M
    UNF Digital Commons UNF Graduate Theses and Dissertations Student Scholarship 2004 A Test Suite Generator For Struts Based Applications Gregory M. Jackson University of North Florida Suggested Citation Jackson, Gregory M., "A Test Suite Generator For Struts Based Applications" (2004). UNF Graduate Theses and Dissertations. 294. https://digitalcommons.unf.edu/etd/294 This Master's Thesis is brought to you for free and open access by the Student Scholarship at UNF Digital Commons. It has been accepted for inclusion in UNF Graduate Theses and Dissertations by an authorized administrator of UNF Digital Commons. For more information, please contact Digital Projects. © 2004 All Rights Reserved A TEST SUITE GENERATOR FOR STRUTS BASED APPLICATIONS By Gregory M. Jackson A project submitted to the Department of Computer and Information Sciences in partial fulfillment of the requirement for the degree of Master of Science in Computer and Information Sciences UNIVERSITY OF NORTH FLORIDA DEPARTMENT OF COMPUTER AND INFORMATION SCIENCES April2004 Copyright(©) 2004 by Gregory M. Jackson All rights reserved. Reproduction in whole or in part in any form requires the prior written permission of Gregory M. Jackson or designated representatives. 11 APPROVAL BY THE PROJECT COMMITTEE The project "A Test Suite Generator for Struts Based Applications" submitted by Gregory M. Jackson in partial fulfillment of the requirements for the degree of Master of Science in Computer and Information Sciences has been approved by the Project Committee: Sentence Deleted Arturo Sanch , Ph.D. Project Director Sentence Deleted Sentence Deleted Charles Winton, Ph.D. Graduate Director 111 ACKNOWLEDGEMENTS This project is dedicated to my father, Marshall Jackson, who always pushed me to work hard on everything I do and showed me that if I put my mind to it, anything is possible.
    [Show full text]
  • Copyright by Ali Hussein Ibrahim 2009 the Dissertation Committee for Ali Hussein Ibrahim Certifies That This Is the Approved Version of the Following Dissertation
    Copyright by Ali Hussein Ibrahim 2009 The Dissertation Committee for Ali Hussein Ibrahim certifies that this is the approved version of the following dissertation: Practical Transparent Persistence Committee: William R. Cook, Supervisor Don Batory Antony Hosking Daniel Miranker Keshav Pingali Practical Transparent Persistence by Ali Hussein Ibrahim, B.S., M.Eng DISSERTATION Presented to the Faculty of the Graduate School of The University of Texas at Austin in Partial Fulfillment of the Requirements for the Degree of DOCTOR OF PHILOSOPHY THE UNIVERSITY OF TEXAS AT AUSTIN August 2009 Dedicated to my parents, Dr. Hussein Ibrahim and Dr. Nihal Nounou. Acknowledgments Many people have contributed to the work in this thesis. I owe a lot of thanks to my advisor, William Cook, who mentored and supported me while I worked on my research. I would also like to thank Ben Wiedermann with whom I collaborated with on several projects related to my thesis. Finally, I would like to thank my thesis committee, Don Batory, Daniel Miranker, Keshav Pingali, and Tony Hosking, for their advice and guidance. On the personal side, I would have been lost without my wife, Som- mayah, who supported and encouraged me during the entire Ph.D process. And of course, none of this would have been possible without my parents. v Practical Transparent Persistence Publication No. Ali Hussein Ibrahim, Ph.D. The University of Texas at Austin, 2009 Supervisor: William R. Cook Many enterprise applications persist data beyond their lifetimes, usu- ally in a database management system. Orthogonal persistence provides a clean programming model for communicating with databases.
    [Show full text]
  • ADPLUS, 307–308 Aggregate Method, 260 ASP.NET MVC Index View, 180 in .NET 4.0 APM, 183 Asynccontroller, 181 EAP, 181 Indexasyn
    Index A page lifecycle, 166 synchronous WebForms implementation, 167 ADPLUS, 307–308 Async and await keywords Aggregate method, 260 asynchronous web page word count, 137 ASP.NET MVC CalculateMeaningOfLifeAsync method, 135 Index View, 180 catch block, 136 in .NET 4.0 coercing result, 135 APM, 183 keyword performance, 136 AsyncController, 181 mechanics EAP, 181 awaiter implementation, 146 IndexAsync implementation, 182 GetAwaiter method, 146 IndexCompleted method INotifyCompletion interface, 146 implementation, 182 TickTockAsync method, 145, 147 Multiple Async I/O Operations, 183 reserved word language, 135 in .NET 4.5, 184 return type method, 135 Synchronous Controller, 179 SynchronizationContext, 137 ASP.NET Web API synchronous structure, 134 in .NET 4.0, 186 synchronous web page word count, 136 in .NET 4.5, 187 task delay Synchronous, 185 synchronous back off and retry, 140 ASP.NET WebForms thread efficient back off and retry, 140 AuthorRepository implementation, 167 task effects, 137 GetAuthors method, 167 Task.WhenAll in .NET 4.0 downloading documents one by one, 141 Begin method implementation, 171 download many documents Complex Async Page, 174 asynchronous, 141 End method implementation, 172 error handling, 142 error handling, 175 Task.WhenAny IAsyncResult, 172 task code, 143 lifecycle, 170 UI updation, 143 marking, 170 winning task, 143 registering, 171 UI event handler, 133 in .NET 4.5 UI responsive goal, 134 async and await, 178 UI thread RegisterAsyncTask method, 177 API ways, 139 Task.WhenAll, 178 asynchronously loading web
    [Show full text]
  • A Process Engine Independent Architecture Enabling Robust Execution of Mobile Tasks in Business Processes Master Thesis at the University of Ulm
    University of Ulm | 89069 Ulm | Germany Faculty of Engineering and Computer Science Institute of Databases and Information Systems A Process Engine Independent Architecture Enabling Robust Execution of Mobile Tasks in Business Processes Master Thesis at the University of Ulm Submitted by: Steffen Musiol [email protected] Reviewers: Prof. Dr. Manfred Reichert Prof. Dr. Thomas Bauer Adviser: Rüdiger Pryss 2014 Copy April 15, 2014 c 2014 Steffen Musiol This work is licensed under the Creative Commons. Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/de/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. Composition: PDF-LATEX 2ε Abstract With the fast improvements of mobile technology in the last century, the importance of mobile and pervasive computing has increased in all disciplines of computer sci- ence. The new technologies have set the stage for a whole set of new applications (e.g., medical- [8][3] and business-applications). Since Business Process Management Systems (BPMSs) are an established and widely used technique in various businesses and industries to manage recurring workflows and to support people in performing their tasks efficiently, the integration of mobile support into a business process environment is desirable. In prior research work, a framework to foster the execution of business processes on mobile devices was introduced. It describes a life cycle for mobile tasks based on an automated delegation mechanism and a backup operation for escalation handling. In this work, the framework will be extended to cope with crucial shortcomings such as the execution of mobile tasks in an unreliable network.
    [Show full text]
  • Access Point Administration Guide Domibus
    EUROPEAN COMMISSION DIGIT Connecting Europe Facility Access Point Administration Guide Domibus 3.3 RC1 Version [0.03] Status [Validated] Date: 18/07/2017 Domibus 3.3 RC1 Administration Guide Document Approver(s): Approver Name Role Adrien FERIAL CEF Technical Office Document Reviewers: Reviewer Name Role Yves ADAM CEF Technical Office Summary of Changes: Version Date Created by Short Description of Changes 0.01 30/05/2017 Yves ADAM Initial Document 0.02 26/06/2017 Chaouki BERRAH Draft (Merged Documents) Ioana DRAGUSANU Thomas DUSSART Tiago MIGUEL Cosmin BACIU 0.03 06/07/2017 Chaouki BERRAH Mysql Schema line added for Tomcat Page 2 / 128 Domibus 3.3 RC1 Administration Guide Table of Contents 1. INTRODUCTION ................................................................................................................. 6 1.1. Purpose ...................................................................................................................................... 6 1.2. References ................................................................................................................................. 6 2. CONVENTIONS ................................................................................................................... 8 2.1. Example 1: Sample Oracle Statement ....................................................................................... 8 2.2. Example 2: Sample Configuration file ....................................................................................... 8 3. PREREQUISITES .................................................................................................................
    [Show full text]
  • Ebean V2.6.0 User Guide May 2010 1 Contents Introduction
    Ebean v2.6.0 User Guide May 2010 1 Contents Introduction Features Overview Mapping Query Transactions Data Types Field access and Property access Property Access Field Access Enhancement and Subclass generation Subclass Generation Enhancement 2 Introduction 2.1 Ebean Ebean is an open source Object Relational Mapping tool. It's goal is to provide a simpler alternative to JPA (Java Persistence API) implementations such as Hibernate and Eclipselink. It does this by providing a “sessionless” API and a simpler query language. That means: – No Session Object (or UnitOfWork or EntityManager) – No Attached or Detached Beans – No merge(), persist(), flush(), or clear(). Instead Ebean has save() and delete() I have found (so far) that this is a bit hard for many people familiar with JPA / Hibernate / Eclipselink etc to get their head around. The short answer is that Ebean, just like JPA has a Persistence Context but has some architectural differences to allow it to have a different approach to the entity bean lifecycle and removing the need to manage EntityManagers. 2.2 Why Ebean? ... why different from JPA? Ebean uses the JPA Mapping annotations and will follow those very closely. However, Ebean has been architected and built from a different perspective than JPA. The Architectural and Query language differences are reasonably fundamental to both Ebean and JPA so its hard to see these differences going away anytime soon. It becomes a question of whether this different approach taken by Ebean has technical merit and has made Ebean an easier ORM to understand and use. 2.2.1 Architecture: Session / UnitOfWork / EntityManager JPA is architected to use an “EntityManager” which closely matches a Hibernate “Session” and a Toplink “UnitOfWork”.
    [Show full text]