NoSQL Database for Software Project Data

Anna Bj¨rklund o

January 18, 2011 Master’s Thesis in Computing Science, 30 credits Supervisor at CS-UmU: Ola ˚gren A Examiner: Fredrik Georgsson

Ume˚ University a
Department of Computing Science SE-901 87 UME˚ A SWEDEN

Abstract The field of databases have exploded in the last couple of years. New architectures try to meet the need to store more and more data and new kinds of data. The old relational model is no longer the only way and the NoSQL movement is not a trend but a new way of making the database fit the data, not the other way around. This master thesis report aims to find an efficient and well designed solution for storing and retrieving huge amounts of software project data at Tieto. It starts by looking at different architectures and trying three to see if any of them can solve the problem. The three databases selected are the relational database PostgreSQL, the graph database Neo4j and the key value store Berkeley DB. These are all implemented as a Web service and time is measured to find out which, if any, can handle the data at Tieto. In the end it is clear that the best database for Tieto is Berkeley DB. Even if Neo4j is almost as fast, it is still new and not as mature as Berkeley DB.

ii

. . 16 The questions . . . . . . . . . . . 17 . . . . .2 2. . . . . . . . . .2. . .2 3. 15 The questions . . . . .2 4. . . . . . . . . . . .1 4. . . . Document store . . 1 1 3 3 4 4 5 6 6 7 7 9 9 2 Modern Databases 2. .1 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Questions . .1 4. . . . . . . . Storing data today . . . . . 2. . . . . . . . . . . . . . . .3. . . . . . . . .2 4. . . . . . . . . . . . .1 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 The databases . . .3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. 12 13 4 The solutions 4. . . . . . . . 14 Strengths and weaknesses . . . . . . . . . . . . . . . . .1 4. . . . . . .1 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. . . .1 2. . . .3 4. . . .1. . . . .2. . . . . . . . . . . . . . . . . 16 Strengths and weaknesses . . . . . . .4 ACID v. . . . . . . . . . . . . .2 5 Results iii PostgreSQL . . . . . . . . . . . . . . 15 Berkely DB . . . . . . . . . . .Contents 1 Introduction 1. . . . . . . . . . . . . Key value store . . . . . . . . . . . .3. . .3 The data . . . .1 Paper outline . . 3 The problem at Tieto 3. . . . . . . . . . . . . . . . . . . . .3. . 18 Strengths and weaknesses . . .1 3. . . . . . . . . . . . . . .2. . .two different ways of achieving partitioning . . . . The CAP Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 A brief history . . . . Column store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 21 Neo4j . . . . . . . . . . . .2 2. . . . . . . . . . . . . . .3 2. . . . . . . 13 The questions . . . . . . . . . . . . . . . .3. . . . . . . . . . . . . . . . . . . . . . . Graph database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 4. .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7 Acknowledgements References 31 33 A Data from test runs 35 A. . . . 35 A.1 Server times . . . . . . . . . . . . . . .1 Future work . . . . . . .2 Client times . . . . . . . . . . . . . . . . . 38 . .iv CONTENTS 6 Conclusions 29 6. . . . . . . . . . . . . .

22 23 24 25 26 27 v . .4 5. . . . . . Client times for 10% of the data without PostgreSQL . . . . 10 10 11 12 An example of how a shared property gets duplicated in Berkeley DB . . . .6 An An An An overview of the data .4 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . example of an inconsistent tree . . . Total time for the server. . . . Total time for the client for question 7 at different amounts of Client times for question 8-13 . . . . . . . . . . . . . . . . . example of how a property is shared between different nodes example of a consistent tree . . . . . . . . . . . . . . . . Client times for question 1-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 5. .2 3. .List of Figures 3. . . . . . . . . . . . . . . . . . . . .3 3. . .1 5.2 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 3. . . data . .1 5. 18 Total time for the client. . .

vi LIST OF FIGURES .

. . . . . . . . Client times for all test runs at 1%. . 6 . . . Time in seconds. . . . . .List of Tables 2. Time in milliseconds. . . .4 A. . .3 A. . . .2 A. Client times for all test runs at 10%. . Time in milliseconds. . . . . . . .6 A. . . . . . . . . The table retured by PostgreSQL for the inconsistent example The server times for 0. . . . .5 A. . The server times for 100% of the data. .1% of the data. . .8 A. . . . Client times for all test runs at 100%. Time in seconds. . . . . . . .1 A. . . . . The server times for the hash table. . . . . . . . Time in seconds. . . . . . . . Time in milliseconds. . Time in milliseconds. . . . Client times for all test runs at 0. . Time in milliseconds. . . .9 An example of data organized in a table . . . . The server times for 1% of the data. The server times for 10% of the data. . . . . . . . . .1 4. . .1 A. 14 . . . . .7 A. . . . . . . . . . Time in seconds. . . . . .1%. . 35 36 36 37 37 38 38 39 39 vii . . . . . . . . . . . . .

viii LIST OF TABLES .

the main problem is deciding which architecture of data storing is best suited for the data. This paper will look at three different database solutions for software project data at Tieto Ume˚ and compare a them. not only the traditional relational SQL database but several other architectures designed to handle different types of data. Chapter 5 presents the result of the implementation with extra attention to performance and the specific requirements from Tieto. Since the 70s and into the new millennium the relational model was the dominant and almost all databases followed the same basic architecture. 1.Chapter 1 Introduction Today there exist many different types of databases. At the beginning of the new millennium developers started to realize that their data did not fit the relational model and some of them started to develop other architectures for storing data in databases. the data they have and how this data fits different architectures. 1 . When choosing a database today the problem is much more complex then deciding on a vendor for the relational database. First a theoretical approach is made and then all three are implemented and are tested to see which is fastest in a test with the real data. Chapter 3 takes a deeper look at the problem at Tieto. Chapter 4 describes the three different solutions implemented and where the strengths and weaknesses lie in each solution from a theorecial point of view. reliability and so forth. When that decision is made it is time to choose a vendor that meets the companies requirements regarding price.1 Paper outline Chapter 2 begins with a brief history and then takes a deeper look at the different solutions for data storing that exist today. Chapter 6 addresses what is left to do and how Tieto can move forward with this.

2 Chapter 1. Introduction .

The continuing trends of cloud computing and growth of social networks will only fuel the need for large data stores even more. The idea is not that relational databases are bad and wrong. At that time developers started to think outside the box and realized that they had data that did not fit the relational model. memory is thousands of times larger and the main bottleneck is the bandwidth between disk and main memory. The two main disadvantages that RDBMS have are that they do not scale easily (in the next Section it will be obvious why) and they often fail at capturing the relation between the data.1 A brief history In the 70s databases was a growing field and there were some debate on how to organize the data. System R is the foundation for many of todays popular DBMSs (Database Management System)[9]. There were some products but most of them were only available within the company and for a specific solution. today there are a lot of different markets with completely different requirements. But if the data does not fit the relational model it is worthwhile to look at another types of database. In early 2009 it was reused by the organizers of an event to discuss open source distributed databases and was a reference to the naming convention of traditional relational databases. Only a few years ago these problems was not such a big problem but the amount of data that is in store today is infinitely much more than only ten years ago. 3 . Today processors are thousands of times faster. The hardware design in the 70s and 80s were much different from today. such as MySQL and PostgreSQL. in the beginning there was a text terminal and today there is a graphical interface. IBM developed System R and it was the first system to implement a Standard Query Language (SQL). just that in some cases the relational model just isn’t enough. Despite the changes in requirements and hardware the relational model was the dominate one until the beginning of the new millennium.Chapter 2 Modern Databases 2. Yet another difference is the user interface. The phrase NoSQL was first used in 1998 as a name for a lightweight relational database that did not expose a SQL interface. Several started to develop different ways to organize their data depending on their specific needs. If the If the relational model fits the data then it is a good idea to use it. Today the expression is often thought of as Not only SQL and is the movement of other database solutions than a relational database. The main market for RDBMS (Relational DBMS) in those days was business data processing.

If this is the main goal. This is referred to as eventual consistency and as the term implies. Soft state.2 The CAP Theorem To be able to discuss the different database solutions that exist today it is important to have an understanding of the CAP theorem [3]. a Web service can at most choose two of the three. Today transactions are something natural and most databases support it. some even demand it for some type of update. BASE . Jim Gray [4] proposed how a partitioned database could guarantee consistency by making sure updates were done in transactions that followed some given guidelines. it only means that the database cannot guarantee that every node have the exact same picture of the data at all times. ACID (Atomicity Consistent Isolation Durability) and BASE (Basically. The properties of a transaction are Consistency a transaction only commits if it preserves the consistency of the database Atomicity a transaction either commits or not. If there are requirements on uptime or the data is massive there might be necessary to partition the data between several nodes and make a compromise on one of the other. 2. One important note is that inconsistency is not always inconsistency. In 1981.1 ACID v. One node can never guarantee a given uptime and for some companies this is so important that they can tolerate a database that is inconsistent at times to guarantee availability. Available. Most relational databases can promise consistency and availability and this is good for smaller system. But in 1981 when Jim Gray reinvented transactions it was something new and it is on that foundation most systems are built today. ACID and BASE are not databases but more of organisation schemas that can give guidelines how a database can operate to be as good as it can be for the third criteria. but not all the time. They do guarantee that all nodes will have the same picture at some time. In 2002 Gilbert and Lynch proved that Brewer was right for asynchronous network. which is a network where the nodes does not share a clock but have to rely on the messages that are sent between them. The CAP theorem states that it is impossible for a Web service to guarantee all three of the following properties: Consistency – all clients have the same view of the same data at all times Availability – all clients can always read and write Partition-tolerance – the system works well despite physical network partitions All three are desirable for all Web services but at PODC 2000 Brewer [3] made the conjecture that it is impossible to have all three.two different ways of achieving partitioning If a database needs to be physically partitioned then the CAP-theorem states that it needs to choose to give up either A (availability) or C (consistency). it acts as an atomic operation . The CAP theorem states that any database solution can only fulfill two of the criteria and that it is up to the architecture to choose which two. Since this is the case for most web services it has a major impact on the decision to choose the right model for storing data. the data fits the relational model and there are no requirements on uptime then the relational model is a good choice. Eventually consistent) are two different ways of doing this. the database will be consistent at some time but not all the time. Modern Databases 2.4 Chapter 2.2.

Grays rules guarantee that a database stays consistent even then partitioned. It is worth mentioning that not all non-relational databases operate in the same space of the CAP-theorem and there is no clear way of saying that a specific type of NoSQL database is in any specific area. for example when we pay with our credit card it takes a day or two before it can be seen on the bank statement. Today there are several solutions that operate in different areas of the CAP theorem and the same database can exist in different areas depending on configurations. Ebay [7] suggested that trading some consistency for availability can lead to dramatic improvements in scalability. hence the eventually consistent part of the acronym. The notion of having inconsistent data. They risk losing millions in revenue if customers cannot access their web store at all times because they have customers from all around the world.3 Storing data today Today there exist some famous non-relational database systems. even if it only is for a moment. instead there is money and time to be saved by choosing carefully and finding the model which fits the data the best. Another problem with the rules is performance. Storing data today 5 Durability once a transaction is committed. Available. This is something we all come in contact with at some point in our lives. . The main point here is to allow some of the data to be inconsistent at some times but not all the time. His solution has the acronym BASE (Basically. Googles Big Table. 2. it cannot roll back Isolation no other transaction can see the events in a non-committed transaction In the original paper there were no I. the cost to keep the data consistent is not nonexistent. Amazons Dynamo and Cassandra (used by Facebook and Twitter) name a few.2. In 1998 Jim Gray was awarded the Turing Award1 for seminal contributions to database and transaction processing research and technical leadership in system implementation [14]. it was added later in 1983 by Andreas Reuter and Theo Haerder [5] to form the acronym ACID (Atomicity Consistent Isolation Durability). Another example of this is Amazon and their solution Dynamo [2]. There are no reasons to choose an RDBMS and try to fit the data into it. If Amazon tolerated downtime on parts of the store at any given time the word would spread and they risk losing reputation and customers. Functional partitioning is dependent on the actual data stored and for some systems this technique will not work well. Eventually consistent) and uses functional partitioning as a method of partitioning the data.3. The term NoSQL does not denote a specific type of database but can be divided into several different types of 1 The Turing Award is recognized as the ”highest distinction in Computer science” and ”Nobel Prize of computing”. is very scary to some computer scientist. Because of this they tolerate that different nodes have different views of some the data at short periods of time. When it is night at one part of the world another part has daytime and millions of potential customers choose between them and another online book store. As a solution to these problems Dan Prittchett. The important thing is to choose which data to allow inconsistency on and partition the system according to this. It allows some data to be inconsistent between different partitions at some period in time and uses persistent messaging to make the data consistent at a later point. There are also several open source solutions with varying quality. Soft state. but the price for this must be availability according to the CAP theorem.

Hammargr¨nd 2 a 123 94. but only on the surface. The key is used to access the stored value and the stored value can be anything. John Svensson. The main advantage with this type of storage is that it is schema less. Another famous one is Googles Bigtable. 1986-09-23. Hammargr¨nd 2. 2. In a column store the data is stored in columns instead. the database engine handling the persistent data is often very advanced. In that case a read-optimized system is better suited and a way to achieve this is a column-oriented organization [10]. Malin Olsson. 735 12 ¨rebro. This row-oriented architecture gives fast writes and is called write optimized. Storgatan 54. Sundsvall a This is optimized for systems that does lots of writes but does not work well with systems that handle few writes with lots of data in each write and lots of querying in between the writes. Sundsvall O o Then the columns of data are stored together and when querying it is not necessary to read unimportant columns to memory. This may seem very simple and it is. John Svensson. 735 12. Modern Databases non-relational databases that all have different characteristics and are suitable for different types of data and in different situations. G¨teborg o Ove Nykvist. Ove Nykvist 1976-02-10. 345 19. thus making it faster for some types of operations. 1986-09-23. ¨rebro O Malin Olsson. 345 19. G¨teborg . this is a model that suits lots of data and is easy to understand for most humans. 1967-05-02. One disadvantage of this type of storage is that it makes joins very time consuming and some column stores does not support join operations on the data.2 Key value store A key value store stores anything as a key/value pair. Storgatan 54. Cassandra is one of the most famous of the wide column stores and is used by both Facebook and Twitter. Nygatan 12.6 Chapter 2.3. in theory there . The traditional way a RBDMS organizes the data is in records and these are continuously placed in storage.1: An example of data organized in a table The data cannot be stored in two dimensions on disc since disc is sequentially accessed.1 Column store Most data today is organized in tables. though Twitter use a slightly different configuration called Twissandra. 123 94. 1976-02-10. 1967-05-02 Nygatan 12.3. Name John Svensson Malin Olsson Ove Nykvist Birth date 1976-02-10 1986-09-23 1967-05-02 Address Nygatan 12 Storgatan 54 Hammargr¨nd 2 a Zipcode 123 94 345 19 735 12 City ¨ Orebro G¨teborg o Sundsvall Table 2. 2. making it faster to read a particular column to memory and making calculations on all values in a column.

. an integer or something like that.3.3. a string.3 Document store A document store is a special kind of key value store. An open source alternative to Dynamo is Voldemort [13] Another key value store is Berkeley DB which is one of the databases that is used in this paper. Some vendors include some way of indexing the nodes for easy access. This model will then work poorly and it would have been better to use another type of database instead. it does not store the document (the value) as a mass of data. The most famous of the key value stores is Amazons Dynamo with was already discussed earlier.3. The notion of storing data in something else besides an RDBMS is nothing new. something that is hard to achieve with a traditional RDBMS. even if the attribute is something not even conceived at design time. The main disadvantage is that inhereted relations between data are lost and since anything can be stored it is up to the client to interpret the data returned by the store.2. JSON or something else that the database can understand. The nodes have attributes or properties and the vertices have types or names. MongoDB [1] and CouchDB [12]. There are no problems adding attributes to records after they have been inserted into the database. The main advantage is the speed and ease that data can be stored in a persistent way. This allows queries on the data and not just the keys as is the case for a key value store. In the last years there have been an exponential growth of data and the need to use something else than an RDBMS has also grown exponentially. The value can be anything but is usually an object of the implementing language or a string.4 Graph database In a graph database the data is stored as nodes and vertices between the nodes. This also allows for a much more flexible solution than an RDBMS since the database has no schema. There will be problems if the data is tabular in nature with little or no relationship between nodes. The main advantage with this type of storing is the possibility to traverse the nodes with known mathematical graph traversing algorithms. In practice the key is usually some primitive of the programming language. there have been several projects for as long as there have been computers. 2. Storing data today 7 are no constraints on the key or the value. and it uses information in the document to index the document. 2. This makes the document store very flexible. Because of this there are demands on the data in the document. The data is extracted by traversing the nodes and vertices in different ways. It is easy to support physical partitioning and most support the eventually consistent idea behind BASE. This is usually accomplice by XML. As with all these different ways of storing data it will only work if the data fits the model. More on that will follow later. Some famous document stores are Raven [8]. it has to be structured in some way.

Modern Databases .8 Chapter 2.

making the picture a little more complicated. it is designed to handle any type of data and scalability was not an issue for the designers.1 is a picture to help understand the organization of the data and also give an idea of how many nodes there are in each level. The picture is an overview of how the data is organized. the B nodes have information on which C nodes they relate to and so forth. the B and C nodes are very similar and have properties that they share. A.2 is a small section of the big graph and an illustration of how one of the properties of the data in the nodes makes them connected. This is the nature of the data. The easiest way of describing the data is by using a graph. A C node has no information about which B nodes it connect to. These properties are removed from the data for this thesis to make the implementation a little bit easier. The information of the relationships lies entirely on the upper nodes. The choice is described later. in the implementations there exist a relationship both ways. This became a big problem when the amount of data became much larger than anticipated at design time. There are four different levels of nodes. the nodes also have some metadata attached to them and each node has a predecessor. B. Therefore this thesis will only give a general schematic picture of the data and not use the correct names or labels. Since the main goal of this thesis is to implement and test different databases and see if they can handle the amount of data these simplifications should not make the result differ too much from reality. first a look at the data at Tieto. Figure 3. There are no vertices between nodes of the same level and only vertices to a node of the adjacent level.Chapter 3 The problem at Tieto The database today has two major problems.1 The data The content and the nature of the content of the data is a company secret. 3. 40 million relationships between nodes and 100 million values. in the real data there are some vertices from A to C. In total there are 4 million nodes. This is a simplification of the real data. The C nodes have information about which D nodes it relates to. At the same time they want to know if a different kind of database can do the job better. Figure 3. and D. the B node cannot be stored. C. 9 . Because of this it is a requirement among all solutions that nodes are entered in the right order. One of the questions Tieto wanted to have answered is if a more specific design of an RDBMS can help with scalability. If a B node is entered into the database without all C nodes it relates to already being there.

These implementations try to be as good as it gets for the majority of the graph but not optimal for any one part of it.10 Chapter 3. the number of nodes and the number of properties shared between the nodes differ a lot depending on where in graph the calculations are made. This makes it harder to implement an optimal solution. Figure 3. the number of vertices between the different levels. The nature of the graph.1: An overview of the data A node has on average one or zero connections to properties but the number vary a lot and others have up to ten.2: An example of how a property is shared between different nodes . An algorithm that works nice in one part of the graph may be a catastrophe at another part. The problem at Tieto Figure 3.

It is only in the sub tree of one A that all C nodes with the same value in the attribute must be the same node. Figure 3. This type is called the simple questions without connections and there are nine in this solution. B3-C4 and B4-C4. How and why inconsistencies occur is to closely connect to the nature of the data to be revealed here. The Questions 11 3.3: An example of a consistent tree Note that the attribute in question is a very specific attribute and that it is only in a sub tree under a given A that this is interesting. These questions are – Return a sub tree of a given A – Return all B that connect to a given C – Check the difference between two A. return all nodes unique to A1.3 the sub tree of A is consistent but in 3. . If the sub tree is consistent the question only return true. For all cases of inconsistency the database returns the value of the attribute and all B-C pairs where the C-node has the value of the attribute. B2-C2. In two different sub trees there are some C nodes with the same value that are not the same C node but this is permitted. They do occur at some points and the solution at Tieto today cannot tell in which nodes the problem is.b = Y.3 and 3. In Figure 3. The properties are one or two and all nodes returned must have the given property. The first type is a simple get a set of nodes with a given property. To illustrate this see Figure 3.2 The Questions The questions asked to the database can be divided into two different types. In this case the question will return a=4 and a list of BC-pair. it only gives true or false if the sub tree is consistent or not. The other type is a set of more complicated questions where the connections between the nodes are explored.a = X AND table.3. unique to A2 and all nodes A1 and A2 have in common in three different lists – Check if a tree under A is consistent and if it is inconsistent return how it is inconsistent A sub tree under an A is inconsistent if two C have the same value in a specific attribute but are not the same node.2. In PostgreSQL a typical question is SELECT * FROM table WHERE table.4 there are two C-nodes that have the same value of a=4 but they are not the same node.4.

One major advantage was also that it is written in Java and well documented. a free Open Source RDBMS that is known to have good performance. The problem at Tieto Figure 3. This was because they are very different in their architecture from the other two and it is interesting to see if they are as good as they should be on the simple requests and how bad they are on the more complicated questions. . The last database was a choice of either a document store or a key value store. One major advantage was also that Tieto already had this installed for other testing purpose. a Swedish open source graph database. Berkeley DB is also well documented and has several examples. a key value store that had recently been rewritten for Java. Because of the nature of the data one of the databases is a graph oriented database and the choice was Neo4j. Several were considered but the choice fell on Berkeley DB.4: An example of an inconsistent tree 3.12 Chapter 3. It previously only existed in C with a library that could run the C-version in Java but with the new version the cost for inter language translation was avoided.3 The databases One of the databases chosen was PostgreSQL.

4. there are approximately 18 million rows in the table joining B and C nodes. The main table structure is straight forward. The main reason for this limitation is time. All three solutions operate in the same space of the CAP theorem.sql. All questions regarding the relationship between the B and C nodes will be costly any way it is done. The time for this thesis is limited and it was decided that it was better get as much functionality as possible instead of spending time on error handling for something that may be discarded. This may seem a bit strange and if any of these databases are integrated into Tietos existing systems they need some work in this area. Another possibility would be if the graph could be divided into several smaller sub graphs. This is not the structure of Tietos current solution.1 is also in its own table with a join table that tells which property belongs to which node.* library to communicate with the database.Chapter 4 The solutions The solution is implemented in Java 1. The information about these connections must be in the database and the other solutions for achieving this would have other problems. Pruning the data and discard some of the nodes is not an option. Both Neo4j and Berkeley can be partitioned if the need should arise. none of them are physically partitioned. all data is still relevant in one way or another. This was a requirement from Tieto as this would make it easier to integrate this into their existing systems. The three different data stores implements the same interface and are therefore interchangeable without making any changes to the Web service methods. One way would be to let the table for B nodes contain this information but the number of connections differs widely between different B nodes. Since this is intended as an internal system the data source is trusted and there are no protections against malicious data. one table for each of the levels of nodes with a serial id field and three tables containing the relationship between the different layers of nodes.6 as a Web service. This makes it hard to have any other solution than the one chosen. Then the table could be split into several smaller tables. not even when looking at only the B and C levels so this 13 . The only protection that exists is against faulty data. this is a new design that tries to be as good as it can be for this version of the data.1 PostgreSQL The PostgreSQL solution is implemented in version 8 and uses java. The property described in Section 3. One of the main problems with PostgreSQL can be found in this design. When asking for a specific B it is necessary to query over this table because one important part of a B is with C it connects to. This is not possible for this data.

4. The solutions a 3 3 4 4 4 2 2 B. The last query determined if a sub tree of A was consistent or not.1. Note that before the first row is calculated the variables keeping track of the previous row are set to empty strings and therefore are a value but matches noting from the database.id B1 B2 B2 B3 B5 B3 B4 Table 4.1 is this C the same as the previous row 2. This is sorted primarily on the value of a and secondarily on C.1. If there is any more work done on this solution this questions is definitely worth looking at and implementing a better solution. Given the results of the test runs this is probably not the optimal way of doing this even thought java is good at hashing strings.4.id C1 C1 C2 C4 C4 C3 C3 C. The return structure is not in row format but contains the same information.3 and 3. They are not particularly interesting or special. This was really hard to implement and the final solution is one that uses PostgreSQL for the most part and some java for the final logic.1 keep C and D in a structure . Question 12 gets the unique labelling string for the two different sub trees for the different A nodes. The logic of this solution strives to make as few queries to the database as possible without having to loop the resulting rows more than once. In the test runs the PostgreSQL server was run on the same computer and thus eliminating the time it would take the data to be transferred in a network. The first nine questions are simple select with some joins for retrieving the data. they only return the sub tree or the list of B nodes and does nothing unexpected. Question 10 and 11 does nothing special.14 Chapter 4.1 The questions In this Section the more interesting solutions will be described in some detail. The queries are written to allow the query planner in PostgreSQL as much freedom as possible since it probably is better at the planning then the author of this paper. 1 Fetch the values for the new row 2 is this a-value the same as the previous row 2. organized in a slightly different way. It then uses javas set operators with a hash set on the two sets of strings to get the three different subsets. The java program then has the following algorithm to remove the rows that does not contain the inconsistent a-value.1: The table retured by PostgreSQL for the inconsistent example cannot be done without having more than one copy of some of the nodes.1 for the previous inconsistent example. only simple selects. The overhead of querying the database is something to consider and it is worth a little more logic in the program to not have to query the database more than once for each question. This is the only solution that requires anything else than a java library since the PostgreSQL server runs independently from the java program. For examples of this see Figure 3. The query to PostgreSQL returns table 4.

1 is the previous a inconsistent 3.2.2. one going up and one going down. exceptions and similar things is massive. A node can have several properties and several vertices or relationships with other nodes.2 else (the previous a is consistent) 3.2. These relationships must be of a specific type. The data is retrieved from the database by traversing the graph. Since the data is in a graph structure there was no need to think of any other structure for storing the data. Because the indexing is separate from the database it is possible to .1. One problem with PostgreSQL and other SQL databases is that the programmer needs to be good at SQL to be able to handle writing the queries. In the end this database proved to be the hardest and most time consuming to implement.4.2 Neo4j Neo4j is a graph database and as such it uses nodes and vertices to store data. All attributes in a node are stored as properties and the relationships are set as the nodes get entered into the database. the main way of finding the right nodes should be by traversing the graph with different algorithms.1. a string or an array of primitives or strings.2 Strengths and weaknesses The implementation of PostgreSQL was the first one.2. A property is a key that is a string and a value.2 save all data in the return structure 3.2 keep C and B nodes in a structure 3 else (this is not the same a-value as the previous row) 3. Almost all exception handling is simply printing an error message on stderr and moving on or returning false since there is no use spending time implementing fancy error handling for something that may be discarded shortly.1 discard all saved data 4 set this row as the previous row 4. since this was the database most familiar from previous experience. This is not intended as a key-value store and therefore indexing is not a priority.1 set the return structure as inconsistent 3. Relationships are set both ways so between two nodes there are two relationships with different types. All changes to the database are made in transaction and time and effort was spent on making sure the data in the database did not get corrupted. setting up tables and similar things. There is a big hurdle to get over in order to do things nicely and efficiently. 4. making sure that only nodes in the right direction gets traversed. This helps with the traversing of the tree.2 else (the C is different meaning an inconsistent tree) 2. The value must be one of Javas primitive types. A relationship can also have several properties just like the nodes. Neo4j 15 2.1 set this a-value as inconsistent 2.1. There is no indexing in the graph engine but this semi built in index service uses a Lucene as backend and is as close as it gets to being an integrated index. To index the nodes this solution uses the LucenIndexService that is closely integrated in the database but not a part of it. The amount of code needed to handle calls to the database.

This solution uses version 1. The first time this happened it was a somewhat hard error to find. Question 10 gets the correct A from the index service and then simply traverses the sub tree and returns the nodes. As previously mentioned this is probably not the best way and a different algorithm should be considered if any more work is done on this database. This is very easy in both .16 Chapter 4.2 came out in December 2010. One of the main differences is how the indexing is handled. It begins by making a depth first search with a maximum depth of two. if an index was not removed it showed in a really strange behaviour and the root cause was hard to find. the sub tree is inconsistent. To get the right B nodes all B nodes are examined and the ones with correct A are stored in the return structure. The same is true for question 11. The solutions remove a node from the database and still have it indexed. There are some examples on the web site and a really good API for all of the classes. All nodes that are put in the database get indexed on the different properties that are needed for this. A new object is created for every node that is returned.2 Strengths and weaknesses It was fairly easy to start implementing Neo4j.2. The implementation was finished in November of 2010 and has not been checked against the new version of the database. More information on this can be found on Neo4js web page [11]. the correct C node is found by asking the index service for the node and then asking the database for all its neighbours with the correct relationship. The index service may still return the node but it will not have the correct properties set and when sked for the value of the propery an exception will be thrown. 4. If such a list is found. The only major problem was described above.1 of Neo4j. If there is any future work done on this solution one of the first steps should be integrating the new way of indexing. it is possible to ask for every node that is at a maximum depth from this node and that can be accessed by the correct relationship type.1 The questions The first nine questions are handled by the index service. 4. It is vital that all indices are removed when a node is removed from the database. The database said that the property was not set but the problem was that the node was still indexed by the property and removed from the database. Neo4j makes this traversing very easy. The consistency check really uses the graph properties of this database. When all nodes are traversed the program begins to go through the hash table and searching for a-values that have more than one value in the list. For the most cases a sub tree will be consistent and this should be faster than BerkeleyDB for those cases since it really uses the nature of the graph and only when it is needed. The more complex questions use the graph structure of Neo4j to return the correct nodes. Since this was a test there was a need to store data. The new version 1. Question 12 uses Javas hash set in the same way as PostgreSQL to calculate the different sets from given sub trees.2. For all C nodes it saved the a-value and the C node in a hash table. it is not the same object that got put in the database but it has the same information. The only time nodes are removed from the database in this solution is then all data is removed for testing purposes. A completely missing functionality is the ability to truncate the entire database. The a-value is set as key and the C node is put in a list. Then the correct node has been found the information is moved from the node to the Java object that gets returned. perform the tests and then remove all data to make the database clean for the next test.

It uses annotation to set the class as persistent or as an entity class and the members of the class that are primary. Berkely DB 17 PostgreSQL and BerkeleyDB but no easy solution was found for Neo4j. The test runs was done on solid state drive and Neo4j needs better hardware for the program than the other two databases. The secondary keys have of four different ways of relating to other instances of the same class. BerkeleyDB is owned by Oracle since 2006.4. Both PostgreSQL and BerkeleyDB are older and more mature products.and secondary key. Since BerkeleyDB require all objects to be stored to be set as persistent the information have to be moved from the original object coming in to a Berkeley object that looks the same except for the Berkeley specific annotations.3. For more information on implementation details. MANY TO ONE means that this instance only has one but share that with several other instances of this class. @SecondaryKey(relate=ONE_TO_ONE) Int ssn. @SecondaryKey(relate=ONE_TO_MANY) String[] email. @SecondaryKey(relate=MANY_TO_ONE) String Name. } ONE TO ONE says that the value is unique for every instance in the database. @SecondaryKey(relate=MANY_TO_MANY) String[] family. When returning an object from the database . @Entity class ExampleClass { @PrimaryKey long id. An example will clarify this.3 Berkely DB BerkeleyDB is a key-value store that is originally written in C++ but now has a completely rewritten version in Java.1 to 1. Berkeley stores any java-class that is set to be persistent. 4. A graph is easy to understand and most data with lots of relationships are described as a graph. Because the data is organized as a graph there are several graph algorithms that can be used to solve various problems. Neo4j requires really fast discs or huge amounts of memory to work well. Neo4j is still young and the changing of indexing from version 1. The Linux machine that was used in the developing of this thesis had some real problems with speed. There exist programs that allows for a graphical presentation of the data in the database but none were tested by the author of this thesis.2 shows that big changes are still being made. A primary key is of this type but it is unusual for secondary keys. If an instance may have many but no other instance may have any of the same the relation type is ONE TO MANY and if an instance can have many that it shares with other the relation type is MANY TO MANY. see the API [6].

1.1: An example of how a shared property gets duplicated in Berkeley DB 4. Returning a sub tree needs the database to first get the right A node then looping all B nodes. Therefore this solution uses the naive approach and lets the same C node get explored several times. This means that several nodes may get visited more than once and that is not optimal. Figure 4. When doing this some information about relationships between the nodes are lost. It then needs to do the same for all C nodes to get all D nodes.18 Chapter 4. . The difference between two sub trees is handled in much the same way as with the other databases. In Figure 3.1 The questions As with the others the first nine questions were easy then the indexing part was understood. But if there are only a few of these nodes it will cost more to keep track of which have already been explored than to let them get explored once more. see Figure 4. In Neo4j there was a possibility to store only the C nodes and the a-value and then get the information if the sub tree is inconsistent. In Berkeley DB this would be much harder since there is no link from a C node to its B nodes and on to the A node to make sure only the correct B nodes gets returned. The inconsistency check was hard to do in Berkley DB. The solutions the reverse is done to make sure the correct type of object gets returned. getting the right node from database and finding all C nodes it connects to.2 there is a shared property between the nodes. If a get from the database is costly and there are lots of C nodes that belong to different B nodes in the same sub tree this approach will be expensive. In Berkeley each node will get their own copy of this property and when returned the nodes will have different but identical copies of this property. the id of the C nodes is set to be a secondary index and the search is simple but possibly time consuming. Information on with B nodes a C node belongs to is only stored in the B nodes and therefore it must be search in the B nodes. The search is not hard. Getting down the tree is fairly easy with Berkeley DB as with both the other databases.3. In the other two there is also information on how to get up the tree but this information does not exist in Berkeley DB. The difference here is in the speed of the initial search since it is done twice. If a Berkeley DB object could be returned the search methods would consist of only one line of code.

Those tests were only to test the functionality but even then it was a clear difference in the speed of the test program.3. The outer hashtable have the a-value as key and a hashtable as the value. Berkely DB 19 The supervisor at Tieto.2 Strengths and weaknesses This was a little bit harder than Neo4j to get started on the implementation but after the initial hurdle was cleared there were few problems with getting the code to work. 4. then that a-value is in more than one C node and the tree is inconsistent. Anders Martinsson. . made a solution for his Hashtable and that solution seemed to be a good approach: it stores all the information needed as it makes a depth first search of the sub tree.3. In Berkeley DB this is not possible so all information needed to be saved as the initial search proceeded. No such program has been found but it would be good if it existed. The hashtable has the structure Hashtable<String. Then the initial search is done it is simply a matter of looking at the length of each of the inner hashtables to see if any of them are of greater length than one. Hashtable<String. If so. Then first tested on the developing machine the first reaction was that it was really fast. The inner hashtable have the C node for key and then a list of B nodes for value. The author of this paper has tried to find some graphical program to view the data in the database and handle it manually. In Neo4j only the a-value and its corresponding C node is saved but there it is possible to retrieve the information about the B nodes without having to search the whole tree again. List<String>>> to keep track of all nodes visited so far.4.

20 Chapter 4. The solutions .

This is maybe the most important result of them all. All test runs were done by him on his computer. even though they both keep their data on the SSD. Even if this is a question asked once a day 2 minutes is a very long time to wait for an answer. This seems to affect Neo4j more than Berkeley DB. Neo4j needs almost 25 second but PostgreSQL needs as much as 115 seconds or almost 2 minutes.1%. All times are in tables in Appendix A. Note that the scale in the x-axis is logarithmic and not linear. Neo4j struggles with some of the questions when it comes to 100% of the data but Berkeley DB is still quite fast. First a look at the client times for the different questions at the different percentage levels. Note that the listings of client times for 100% have the numbers for Neo4j and PostgreSQL are multiplied with 4 resp. The server times will not be presented in total here. my supervisor at Tieto. 1%. It can be seen in Figure 5. Time was measured at both client and server. returning a sub tree of A. In total there were almost 500 000 times to analyse at the end of all test runs. For that amount of data there can be no other explanation as to why the cost is so much higher. the client measured the wall clock time for all test runs in milliseconds and the server each questions time in nanoseconds. The trimmed mean has 5% cut of at each end to get rid of any extreme values.1(a) and 5. One other interesting thing that is obvious from these graphs is that the more complex questions that is the hardest seems to be question 12. The test was run 2048 times for each question except for Neo4j and PortgreSQL at 100% because they took so long it was not possible to let them run that many tests. 0.Chapter 5 Results The test program was developed by Anders Martinsson. the difference between two sub-trees and question 10. The impact of this overhead should decrease as the amount of data increases. If the client times are divided by the number of test runs Berkeley DB completes query 12 in less than 5 seconds. only the mean. This is not a persistent database but for comparison reasons test runs were done with this as well for the three smaller data sets. The test runs are made in four different percentages of the data. median and a trimmed mean will be presented. 10% and 100%. When 21 . Neo4j had 512 tests and PostgreSQL had 256 tests per question.1(b) that PostgreSQL has a high overhead cost since it needs to call an external database. Neither Neo4j nor Berkeley DB can keep all the information in memory and need to read from disc. The fact that the total time for running the entire test set was so high that it could not be completed for both Neo4j and PostgreSQL is very telling of which database is faster for the large amount of data. The test program was developed at the same time as the databases and to test it Anders designed a Hash table to handle the data. 8 to give an accurate picture for comparison.

If the original data contains 20 unique value of the attribute in question. (d) 100 % of the data.1 % of the data. PostgreSQL Neo4J BerkeleyDB 2 1.2 the client times for Neo4j. Berkeley DB and the Hash table are plotted for 10% of the data. except for Neo4j which has a top at 100% when the rest of them actually go down in time. With a slower hard drive this would probably not be possible.5 1 0 2 4 6 8 Question number 10 12 14 0 2 4 6 8 Question number 10 12 14 (c) 10 % of the data. There are some explanations for this but the most likely is that the data scales badly for this example. for 10% of the data the time is almost double which means that the time spend calculating the sets is almost nothing compared to the time of getting the sub trees. For 100% the time is still only slightly more than double the time for getting one sub tree. Results 900 800 700 600 Time in seconds 500 400 300 200 Time in seconds PostgreSQL Neo4J BerkeleyDB Hash table 3000 PostgreSQL Neo4J BerkeleyDB Hash table 2500 2000 1500 1000 500 100 0 0 0 2 4 6 8 Question number 10 12 14 0 2 4 6 8 Question number 10 12 14 (a) 0. 8000 7000 6000 Time in seconds 5000 4000 3000 2000 0.22 Chapter 5. especially for Neo4j. PostgreSQL is the slowest for almost every question.1: Total time for the client. One interesting fact is that Berkeley DB and Neo4j almost can keep up with the Hash table. That means that a much larger portion of the data is returned . On the server side the times plotted are the trimmed means because they are generally somewhere in between the mean and median. it drops to 0.5 x 10 5 (b) 1 % of the data. One of the main reasons for this is probably the speed of the solid state drive. The graphs are almost the same. but only just. For question 9 it appears that the hash table is the slowest. In Figure 5.5 and the results are very interesting.5 1000 0 0 Time in seconds PostgreSQL Neo4J BerkeleyDB Hash table 2. A look at question 7 in Figure 5.2 for 1% and is rounded to 1. comparing the times. The maximum seems to be when only 1% of the data is tested. One thing that becomes apparent from these Figures is that some of the simple questions are not so simple after all. Figure 5.

23 800 700 600 Time in seconds 500 400 300 200 100 0 Neo4J BerkeleyDB Hash table 0 2 4 6 8 Question number 10 12 14 Figure 5. .2: Client times for 10% of the data without PostgreSQL than for 10%. A closer look at the exact behaviour of the data and the databases for this question would be interresting but it probably does not influence the final result.

05 0.6 0. Results 0.4 PostgreSQL Neo4J BerkeleyDB Hash table 0.2 0.5 0 0 0 2 4 6 8 Question number 10 12 14 (c) 10 % of the data.15 0. (d) 100 % of the data.1 % of the data.24 Chapter 5. 4 PostgreSQL Neo4J BerkeleyDB Hash table 120 (b) 1 % of the data.5 PostgreSQL Neo4J BerkeleyDB 100 3 80 Time in seconds Time in seconds 0 2 4 6 8 Question number 10 12 14 2. .2 0 0 0 2 4 6 8 Question number 10 12 14 (a) 0.5 2 60 1.3 1. Figure 5.35 PostgreSQL Neo4J BerkeleyDB Hash table 1.4 0.5 40 1 20 0.8 0.3: Total time for the server.2 0.1 0. 3.25 Time in seconds Time in seconds 0 2 4 6 8 Question number 10 12 14 1 0.

1% 1% Amount of data 10% 100% (a) Question 1 200 180 160 140 Time in seconds 120 100 80 60 40 20 0 0.1% 1% Amount of data 10% 100% 0 0.1% PostgreSQL Neo4J BerkeleyDB Hash table (d) Question 4 1% Amount of data 10% 100% 1% Amount of data 10% 100% (e) Question 5 (f) Question 6 Figure 5.1% Time in seconds PostgreSQL Neo4J BerkeleyDB Hash table 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 0.1% 0 0.25 1200 PostgreSQL Neo4J BerkeleyDB Hash table 1200 PostgreSQL Neo4J BerkeleyDB Hash table 1000 1000 800 Time in seconds Time in seconds 1% Amount of data 10% 100% 800 600 600 400 400 200 200 0 0.1% Time in seconds PostgreSQL Neo4J BerkeleyDB Hash table 1200 (b) Question 2 1000 PostgreSQL Neo4J BerkeleyDB Hash table 800 600 400 200 1% Amount of data 10% 100% (c) Question 3 1800 1600 1400 1200 Time in seconds 1000 800 600 400 200 0 0.4: Client times for question 1-6 .

5: Total time for the client for question 7 at different amounts of data .26 Chapter 5. Results 3000 PostgreSQL Neo4J BerkeleyDB Hash table 2500 2000 Time in seconds 1500 1000 500 0 0.1% 1% Amount of data 10% 100% Figure 5.

5 Time in seconds 1% Amount of data 10% 100% 2000 1 1500 1000 0.1% 1% Amount of data 10% 100% (a) Question 8 12 x 10 4 (b) Question 9 60 10 PostgreSQL Neo4J BerkeleyDB Hash table 50 PostgreSQL Neo4J BerkeleyDB Hash table 8 Time in seconds Time in seconds 1% Amount of data 10% 100% 40 6 30 4 20 2 10 0 0.1% 1% Amount of data 10% 100% (e) Question 12 (f) Question 13 Figure 5.1% 0 0.1% 1% Amount of data 10% 100% (c) Question 10 2.6: Client times for question 8-13 .27 1500 PostgreSQL Neo4J BerkeleyDB Hash table 9000 8000 7000 6000 Time in seconds 5000 4000 3000 2000 1000 PostgreSQL Neo4J BerkeleyDB Hash table 1000 Time in seconds 500 0 0.5 x 10 5 (d) Question 11 3500 2 PostgreSQL Neo4J BerkeleyDB Hash table 3000 PostgreSQL Neo4J BerkeleyDB Hash table 2500 Time in seconds 1.5 500 0 0.1% 0 0.1% 1% Amount of data 10% 100% 0 0.

Results .28 Chapter 5.

This was a surprising result especially that it was faster even for the more graphical questions. 6. Neo4j needs time to mature and become a more stable product before suits companies such as Tieto. There is also the problem with the maturity of the product. the database that is the best at handling the data is Berkeley DB.Chapter 6 Conclusions In this paper a question was asked.1 half a year later and in December of 2010 yet another version. The relational database was based on the fact that is already existed in the company and that it is one of the fastest relational databases available. even for the questions that are closely connected to the graphical aspect of the data. A third and completely different database was needed and Berkeley DB is a key value store that had all the qualities. Based on the nature of the data it became clear that one should be a graph database and Neo4j was chosen because it considered to be one of the best on the market. The real data have some properties that are excluded from this first test to make the task a little easier. A good first step would be to identify these and start implementing them as well to see if the results still hold. 29 . The results were pretty clear. version 1. Even though there exist a solution today it is not optimal and at the rate the data is growing Tieto may find themselves in trouble a lot faster than they anticipate. All three were implemented as a Web service and their performance was measured. Even though it data fits the graphical model the best Neo4j just was not fast enough to be able to use its advantage. The first version of Neo4j was released in February of 2010.1 Future work The results are promising and there is definitely worth a continued development of the Berkeley DB part of the solution. is there any database that can handle the amount of data that Tieto have and how good can it get? To answer this question it was necessary to take a look at what architectures that exist today and find some different databases that could do the job.

30 Chapter 6. Conclusions .

a Ola ˚gren. 31 . I thank internal supervisor at the department of Computing Science at Ume˚ Universitet. Without him this master thesis would not have existed since the whole thing was his idea. A Last but not least I thank my husband for everything he has done to support me throwout the entire master thesis project. Anders Martinsson for all his support and help.Chapter 7 Acknowledgements I would like to start by thanking my supervisor at Tieto. I also thank everyone at Tietos office in Ume˚ for making my workday a a pleasant time.

32 Chapter 7. Acknowledgements .

[2] Giuseppe DeCandia. August 18 2010. Adam Batkin. Swaminathan Sivasubramanian. 33 .org/. The End of an Architectural Era (It’s Time for a Complete Rewrite). August 18 2010. August 18 2010. [9] Michael Stonebraker. Project Voldemort. Available. In Proc. ACM SIGACT News. Miguel Ferreira. Alex Rasin.org/. Peter Vosshall.com/. Turing award. 2007. Sam Madden.net/. Nabil Hachem. Elizabeth O’Neil. Partition-Tolerant Web Services. http://neo4j. BASE: An Acid Alternative. Neo4J. Raven DB. Amerson Lin. 33. Brewer’s Conjecture and the Feasibility of Consistent. [13] Project Voldemort. Gunavardhan Kakulapati. Samuel Madden. the graph database. http://ravendb. Avinash Lakshman. http://project-voldemort. [7] Dan Pritchett. Pat O’Neil. 2005. Abadi.org/wiki/Turing Award. Deniz Hastorun. pages 553–564.systomath. [5] Theo Haerder and Andreas Reuter. Stavros Harizopoulos.apache. Daniel J. [4] Jim Gray. Mitch Cherniack. and Pat Helland. 2002. [8] Hibernating Rhinos. Nga Tran. [12] The Apache Software Foundation. Proceedings of Seventh International Conference on Very Large Databases. 2007. database. and Stan Zdonik. The Transaction Concept: Virtues and Limitations. http://couchdb.com/doc/BerkeleyDb-4. C-Store: A Column-oriented DBMS. and Werner Vogels. Alex Pilchin.References [1] 10Gen.org/. [6] Oracle.7/html/java/. 6(3). [11] Neo Technology. Mongodb. Queue. December 6 2010.wikipedia. [10] Mike Stonebraker. 1983. http://www. Abadi.mongodb. http://en. 1981. August 18 2010. SOSP. The A CouchDB distributed Project. 2008. Madan Jampani. Edmond Lau. 41:205–220. [3] Seth Gilbert and Nancy Lynch. Computing Surveys. Xuedong Chen. October 5 2010. 15(4). VLDB ’07. [14] Wikipedia. http://www. VLDB. Principles of transaction-oriented database recovery. Dynamo: Amazon’s highly available key-value store. December 6 2010. Daniel J.

34 REFERENCES .

0664 0.563 0.41 12.9 12.06033 2.6 27.05615 0.1 28.3681 0.59 27.715 1.29 15.22 3.4 326.679 8.403 9. Time in milliseconds.89 28.14 12.67 1.1889 0.9 27.8853 0.7035 81.457 18.09068 0.4028 0.Appendix A Data from test runs Here is the raw data from the test runs.52 59.36 297.37 12.09877 Neo4j trim 0. 35 .722 PostgreSQL trim median 13.3281 0.41 298.86 5.04666 0.38 0.346 0.0648 3.1% of the data.1647 0.648 8.709 8.3518 0.98 25.8562 0.2452 0.1657 0.36 0.3765 0.06052 3.575 0.8656 0.4147 0.37 53.1078 0.06893 0.53 0.114 0.713 mean 0.3445 Berkeley DB trim median 0.09073 0. The values for the Hash table did not fit in the table with the others and therefore it is in its own table.1363 0.619 0.6 25.7 297.74 27.97 32.909 18.813 0.04722 3.7108 82.1964 0.6 0.53 29.297 16.408 59.05806 0.3003 0.09009 0.421 0. The server times are rounded to 4 significant digits.2 326 27.4977 0.5271 0.4 326.74 32.295 2.5486 0.1 53.36 9.7952 0.16 24.06775 0.7852 0.2868 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Table A.978 16.29 3.704 18.4973 0.17 5.18 1.83 29.43 53.1 Server times mean 13.3437 0. A.1: The server times for 0.5086 0.134 8.285 5.05725 0.09334 mean 0.04629 3.13 32.7051 0.2815 0.09506 median 0.288 59.49 68.5257 0.47 3.

368 Neo4j trim 0.4 1044 26.89 105.37 39.09 31.06133 0.08166 0.1761 5.37 36.71 1.066 1. Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 mean 61.3028 median 0.1 Berkeley DB trim median 0.44 179.4219 0.1018 9.97 8.08651 9.36 Chapter A.08418 0.96 31.21 0.59 1.9761 6.2 1807 1806 6.03149 0.016 4.51 382.9 209.8 0. Time in milliseconds.1131 0.015 21.08425 3.8 106.4963 0.9 5.04 64.2: The server times for 1% of the data.13 25.54 median 0.62 37.33 60.14 1.187 120 3.668 15.03 179.099 0.33 1.94 120.1265 0.3 54.9945 37.3 0.338 60.23 32.37 1.4 639.239 5.03178 0.08 0.1332 0.8 17.1246 0.47 86.9983 0.11 160.3 209.6008 6.1 161.418 0.072 200.929 8.54 61.2 49.53 0.75 61.795 14.238 median 0.09 65.8 Table A.08158 0.9 3.23 46.17 32.08234 3.9066 74.3 0.91 17.3: The server times for 10% of the data.81 74.347 69.2 318.32 0.03206 0.91 0.88 36.807 0.734 14.69 3.5008 1.206 8.9 0.0218 3.1026 0.335 3639 3637 27.3035 mean 0.833 0.2 1096 1098 566.429 mean 0. .6 105.7107 105.57 39.1 631.8452 3.119 0.62 61.58 18.93 30.9 0.09 25.4238 0.82 39.018 4.24 37.99 31.48 mean 0.2 5.0829 0.9 0.8292 3.1364 0.5 85.3 3.1775 5.3105 Neo4j trim 0. Time in milliseconds.676 21.004 21.429 3.434 PostgreSQL trim median 18.064 199.7133 107.3 1061 1092 26.024 4.8173 6.9 163.225 319.3 631.7 159.388 0.7 3.5108 0.267 17.9 113.06573 3.05555 0.3 33.37 61.05767 0.499 0.5 1.1032 0.76 381.87 159.09598 9.481 74.072 3641 27.075 17.381 17.1757 5.06575 3.8298 3.05541 0.4 201.01 25.95 18.49 27.77 113.91 27.04 32.118 21.06115 0. Data from test runs Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 mean 18.0554 0.811 0.4841 0.1 161.1335 0.4027 0.7109 0.266 319.7 567.037 6.4 1.76 1.02163 3.1742 119.94 105.27 46.5 PostgreSQL trim median 61.15 29.4 0.1559 120.0664 3.8 187.02161 3.4153 0.21 1.1218 0.29 17.136 Table A.007 37.9 209.245 0.7 1808 6.2 3.4 1097 567.42 114.59 46.8 375.22 1.745 21.76 65.48 21.692 Berkeley DB trimmean 0.237 mean 0.

7 492.5 1136 Berkeley DB trim median 1.001569 0.02497 1.03555 0.2556 0.05084 0.302 5.4 693.88 153 22.2 8473 8559 12.7 19.365 0.8 mean 55.14 11.134 0.8 558.02147 0.1226 0.8 2153 463.38 17.001897 0.006071 1.05 4058 4058 52890 52660 18.A.1872 0.93 394.001787 0.001157 0.37 8.03121 0.55 0.6 495.12 8.0187 0.5 24.04063 0.1217 0.8 731.007589 0.233 0.1213 0.007546 1.366 0.644 504.006041 0.0172 median 0.53 563.001518 0.5418 0.01792 0.794 63.242 0.001779 0.6003 0.4 4075 584.11 262.001138 0.4: The server times for 100% of the data.5 599.2 57.5 291 249. Time in milliseconds.004694 0.5411 0.00142 0.648 442.07295 median 0.8852 Table A.001185 0.001518 0.05061 0.71 8455 16 22320 1540 Neo4j trim median 17.001518 0.332 0.08085 1% trim 0.832 22540 22750 1505 1489 mean 1.5 495.91 740. Server times 37 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 mean 501. Time in milliseconds.008348 0.896 0.6 2144 2135 462.03529 0.87 90.01621 0.009106 0.01594 0.008419 0.6 495.1 19.8 193 3.669 5.7 410.114 0.01404 0.001521 0.5 357.5 77.02466 1.001467 0.001897 0.05122 0.008697 0.1925 0.8 1134 1133 Table A.7 462.2831 0.008829 0.7 4096 4092 524.5: The server times for the hash table.21 36.631 0.004403 0.366 0.005312 0.05151 0.6278 0.001138 0.9 490.001579 0.1.14 157.09 22.301 3.147 0.22 46.05172 0.14 18.001744 0.001719 0.03602 1.62 11.5589 21.269 5.4637 0.06412 mean 0.0408 0.001189 0.009643 0.01769 0.6575 11.1% trim 0.293 0.5779 21.1867 0.7 93.009106 0.02125 0.97 0.99 740.9 697.001518 0.95 14.004174 0.4 25.008618 0. .5044 0.9 338.65 112400 374.03593 1.97 22.001573 0.65 111900 112200 373.89 562.008475 0.9 371.001563 0.8 55.56 0. Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 mean 0.6377 0.37 353.8914 10% trim 0.0406 0.0371 0.02186 0.6 747.03111 0.8829 median 0.3 163.00117 0.7 17.03605 1.5432 0.001518 0.56 9.00144 0.87 14.2 84.261 0.07 378 3.001531 0.95 32.05229 0.7 761.5593 0.006902 1.03216 0.005718 0.239 0.6182 11.008888 0.02483 1.3 PostgreSQL trim median 492.009677 0.001458 0.72 4059 52980 21.0167 mean 0.01608 0.

6 263.455 1. This is the total time for 2048 test runs.485 Berkeley DB 1.57 0. PostgreSQL 39.7 641.02 152.72 2.22 8.7 791.875 9.28 0.837 39. Neo4j and PostgreSQLs times are multiplied with appropriate scalar to give a time for comparison.402 3.357 0.29 181.8 197.217 1.065 0.296 0. Time in seconds.645 1.958 3.142 38.674 4.7 3.33 73.58 698.1 4.92 139.195 Berkeley DB 2.502 1.266 4.7 262.038 67 19.722 23.6: Client times for all test runs at 0.54 198.9 133.52 Neo4j 2.86 1.397 32.891 Neo4j 1.9 61.561 6.5 7.431 7.889 5.31 1.7: Client times for all test runs at 1%.239 0.221 1.2 63.007 0. Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 PostgreSQL 29.35 139.687 23.15 876.8 457 1491 2754 57.006 Table A.341 5.7 11.377 31.4 75.962 0.8 4.383 1.83 Hash table 1.9 97.66 3.745 0.952 30. Time in seconds.956 63.7 285.776 0.38 Chapter A.004 1.16 11. .6 10.147 37.1 3.1%.91 63.22 0.6 905.743 45.983 0.42 74.52 83.6 268.75 26.84 37.872 31.8 350.59 182.74 2.984 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Table A.94 7.233 1.2 215.3 3.53 8.62 182.59 Hash table 1. Data from test runs A.2 Client times Here are the times recordeed by the server in seconds.192 242.7 175.84 127.

2 481.998 1.98 Neo4j 2.457 0. Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 PostgreSQL 1032 1018 48.143 7.1 193.8: Client times for all test runs at 10%.67 3758 52.7 428.7 236.9: Client times for all test runs at 100%.794 496.885 69.38 2.4 2.5 254.628 1.1 844.38 50860 3186 Berkeley DB 4.68 1181 1710 4659 961.9 126.37 494.6 2.478 436.2.2 334.127 2.619 18.8 574.51 154.6 8604 1212 1423 201.6 120.96 193 360.7 Hash table 1.56 198.9 3.44 9654 2349 Table A.62 9.273 26.1 838.041 9.07 246.14 328.A.34 235200 789.9 3.262 31.891 400.7 Neo4j 116.3 1.193 0.874 661.3 4.437 Table A.533 53.6 8322 111000 47.1 68.9 41.1 0. Client times 39 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 PostgreSQL 127.14 7. Time in seconds.405 762. .12 204.1 19970 35.36 7932 58.5 2494 1270 113 791 3940 13.2 114.8 78.899 Berkeley DB 1.5 9.865 1. Time in seconds.006 41.

Sign up to vote on this title
UsefulNot useful