Visualizing Class Diagram Using Orientdb Nosql Data-Store
Total Page:16
File Type:pdf, Size:1020Kb
Visualizing Class Diagram Using OrientDB NoSQL Data-Store Thesis submitted in partial fulfilment of the requirements for the award of degree of Master of Engineering in Software Engineering Submitted By Sawinder Kaur (Roll No. 801431025) Under the supervision of: Dr. Karamjit Kaur Assistant Professor COMPUTER SCIENCE AND ENGINEERING DEPARTMENT THAPAR UNIVERSITY PATIALA – 147004 June 2016 3 ACKNOWLEDGEMENTS I am highly grateful for the assistance of all the individuals who spread their valuable time to help me complete my thesis work in time. Foremost I would like to thank my supervisor Ms. Karamjit Kaur for her constant guidance, in-depth knowledge, immense patience, invaluable time, encouraging words and worthy suggestions that helped me in completing my work. Under her guidance, I explored new areas of research. Her practical work approach helped me expand my horizon of research perspective. She has always been a moral support and true guide throughout my research period. I am also thankful to Dr. Maninder Singh, Head of CSED, and the learned faculty of my department Computer Science and Engineering for their support. The intermediate deadlines set by them helped me work more efficiently. I am indebted to my prestigious institute Thapar University, for providing me a learning and progressive environment. My special thanks to all my friends for their endless support, appreciation and moral boost at times of need. I owe a lot to my family for their emotional support and faith in me, for providing me with an opportunity to be a part of this research programme. Last but not the least I thank Almighty for providing me enough inner strength to pursue my goals and accomplish my work. (Sawinder Kaur) 4 ABSTRACT Relational databases are providing storage for several decades now. The term NoSQL broadly covers all non-relational databases that provide scalable and schema-less model. NoSQL databases are used by major organizations operating in the era of Web 2.0. Different categories of NoSQL databases are key-value pair, document, column-oriented and graph databases which enable programmers to visualize the data closer to the format used in their application. In this paper, class diagram has been merged with OrientDB through Java API to visualize the class diagram as OrientDB graph. OrientDB is the only database which supports both graph and document database, also provides support for both inheritance and polymorphism. In this proposal, an approach is implemented to extract data in the form of class diagram using Java and then storing and running it in OrientDB to represent in the form of graph (using nodes and edges). The methodology employs universal approach for schema extraction by exploiting the class diagram data exported into XML (GraphML) which is supported by most of the NoSQL data stores, hence making the approach generic. Further user queries are handled and formulated on graph database to make better utilization of the extracted data. We have used NoSQL databases and OrientDB which together provides better features by using both document and graph databases. Class diagram is very popular among application developers, but the concept together with non-relational databases is yet to come. To the best of our knowledge, there is no publication that explained class diagram using OrientDB and querying in it to retrieve and update the class diagram without affecting the other classes. Due to limit on length, only two classes of NoSQL Databases: Document-oriented and Graph-based databases together have been covered in this paper. A case-study have been explained and considered to illustrate the way of Class diagram. With the help of five queries data relationship between classes have been depicted through graph in OrientDB and their performance have been noted down. 5 Certificate i Acknowledgements ii Abstract iii Contents iv List of Figures vi Listof Tables vii 1 Introduction..........................................................................................................1 1.1 NoSQL Datastores......................................................................................1 1.1.1 Key-Value Datastore .......................................................................2 1.1.2 Graph-Based Datastore ....................................................................4 1.1.4 Document-Oriented Datastore .........................................................5 1.1.3 Column-Oriented Datastore ............................................................6 2 Literature Survey................................................................................................8 2.1 State of the Art..................................................................................9 3 Problem Statement.............................................................................................16 4 OrientDB.............................................................................................................17 4.1 Features of OrientDB.......................................................................17 4.2 Comparison of NoSQL, Neo4J, MongoDB, OrientDB..............................19 4.3 CAP Theorem..............................................................................................20 4.4 ACID vs BASEConsistency Model............................................................21 4.5 OrientDB Commands..................................................................................22 4.5.1 Datatypes of OrientDB....................................................................23 4.5.2 Basic Commands of OrientDB........................................................24 4.6 Class Diagram..............................................................................................25 5 Implementation....................................................................................................27 5.1 OrientDB-JDBC connectivity.....................................................................28 5.2 Import data in OrientDB using Java API................................................... 29 5.2.1 Add dependencies to POM.xml......................................................31 5.2.2 Creation of Collector class..............................................................32 6 5.3 Hardwae and Software requirements............................................................35 5.4 Proposed Flow Chart to Implement Class Diagram.....................................36 6 Running examples and Results............................................................................37 6.1 Analysing class diagram in OrientDB ..........................................................38 6.2 Movie recommendation system with OrientDB.......................................... .42 6.3 Performance analysis.....................................................................................48 7 Conclusion and Future Scope..............................................................................50 References 51 List of Publications 55 YouTube Video Link 56 7 List of Figures 1.1 Key-Value Database......................................................................................................3 1.2 Graph oriented Data Model...........................................................................................4 1.3 Document oriented Data Model....................................................................................5 1.4 Column oriented Data Model........................................................................................6 4.1 Elastic Linear Scalability.............................................................................................17 4.2 CAP Theorem..............................................................................................................21 4.3 Class diagram for the class Flight...............................................................................26 4.4 Example of Inheritance using tree notation.................................................................27 5.2 Flow chart to implement class diagram.......................................................................37 6.1 RDBMS Model............................................................................................................43 6.2 Time taken by queries during execution......................................................................49 8 List of Tables 1.1 Comparison of Key-value and Relational database.....................................................3 1.2 Comparison of Key-value, Document and Relational database..................................6 2.1 A Review of literature.................................................................................................13 4.1 Comparison of NoSQL datastores..............................................................................20 4.2 Datatypes of OrientDB................................................................................................23 4.3 Syntax of basic OrientDB commands.........................................................................24 5.1 Employee schema table...............................................................................................28 5.2 Hardware Environment................................................................................................35 5.3 Software Environment.................................................................................................36 9 CHAPTER 1 Introduction Data is said to be raw facts and statics which are collected together for reference