<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Benchmarking of Different Approaches for Objects Matching</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dmitry Frolov</string-name>
          <email>frolov.dmtrii@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Master student, Bauman Moscow State Technical University Moscow, Russia and Networks Department, Bauman Moscow State Technical University Moscow</institution>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>371</fpage>
      <lpage>380</lpage>
      <abstract>
        <p>Data matching is widely used in different applications. However, very often we do not know data schema completely of the matching objects, because it might be changed during application use. As a result, objects require different processing methods, depending on their structure. To provide this, a special way of storing data should be used. For building an effective application, we need to choose DBMS suitable for selected storage data structure by measuring time spent on different operations with a high load database. The purpose of this article is to demonstrate a benchmark development which is performing these measurements and estimations.</p>
      </abstract>
      <kwd-group>
        <kwd>Benchmark</kwd>
        <kwd>Friend of a friend</kwd>
        <kwd>object matching</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Nowadays, due to a huge amount of information, describing real-life objects, searching,
comparison and choosing the most suitable object requests are becoming more and
more actual. Data matching is widely used in different applications. It might be
processing of social data and real-time similarity calculation between persons,
recommending systems with computation of scores for different goods for a specific person
and many other domain areas. The data matching issue can be easily solved when the
data structure is fixed and simple, or data can be stored in memory only, but there are
many issues when an object has complex, dynamically changed structure and it
becomes impossible. In that case, we have to speak about using some storages and
databases. Nevertheless, matching of data is a different task comparing with data fetching.
Moreover, very often we do not know data schema completely of the matching objects
because it may be changed during application use. As a result, the answer to which data
structure should be used for matching of some objects is not so obvious. Besides, those
objects require different processing methods for different substructures.</p>
      <p>The main purpose of this work is to do assessment of different implementations of
data storing for solving the task of data matching, on big data databases with complex
objects.</p>
      <p>To achieve this, we need to conduct a performance analysis of the number of
database systems and provide systematic comparison of them. Among analytical modeling
methods for are applicable for DBMS’s are:
1. Queuing Models: Queuing models are effective to study the dynamics of a
database system when it is modeled as a multi-component system with resource
allocation constraints and jobs moving around from one component to another.
Examples of such dynamic studies are concurrent transaction control
algorithms, data allocation and management in distributed database systems etc;
2. Cost Models: Cost Models are useful in studying the cost in terms of Physical
storage and query processing time. The cost model gives some real insight into
the actual physical structure and performance of a database system;
3. Simulation Modeling: A simulation Modeling is more effective for obtaining
better estimates since it not only analyses the database system in isolation but
also can effectively analyze the database system with the application program
running on top of it and the database system itself operating within the
constrained environment of an operating system on real physical hardware;
4. Benchmarking: Benchmarking is the best method when multiple database
systems need to be evaluated against each other but suffer from the inherent setback
that it assumes all systems to be fully installed and operational. Benchmarking
relies on the effectiveness of the synthetic workloads. Real workloads are
nonrepeatable and hence not good for effective benchmarking.</p>
      <p>The most suitable is benchmarking method, because we need to measure a similar
operation on a set of DBMS.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Review of Benchmarks</title>
      <p>
        There are standardized benchmarks called as TPC or “Transaction Processing
Performance Council” [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Which are widely used as benchmarks for transaction processing
and database performance analysis. These benchmarks do not solely evaluate the
database component of the system but rather evaluates the whole system of which the
Database system is one of the key differentiating factors. The suite contains a mix of
benchmarks for evaluating different performance aspects of such systems.
• TPC-C Benchmark – contains a mix of different types of concurrent transactions, a
complex database, nine types of tables with different record and population sizes. It
simulates the process of a multi-user environment making concurrent queries to a
central database. The performance evaluation involves a thorough monitoring of all
system state parameters for the correctness of update as well as performance
parameters such as service time etc. This benchmark is most suitable for businesses that
need a database to support online handling of orders, sell product and manage
inventory.
• TPC-E benchmark – designed for evaluating database systems needed to be installed
at brokerage firms. It is quite similar to the TPC-C benchmark in terms of setup and
components differing only in the design of the transactions that are more relevant in
a brokerage firm environment such as account inquiries, online trading and market
research, etc.
• TPC-H benchmark – is fine-tuned for decision support systems. The transactions in
such environments are characterized by business intelligence intensive complex data
mining queries and concurrent data modifications. The performance metric used to
evaluate such systems is generally TPC-H composite query per hour.
      </p>
      <p>
        TPC is the largest and most popular benchmarking authority, but, still there are
some other benchmarks among them [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]:
• Bristlecone [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] – is a Java-based database performance testing benchmarking utility.
      </p>
      <p>
        It provides knobs to vary the system parameters for a single scenario across different
sets of rules or environments. The standard run parameters for synthetic replication
include a number of users, number of tables, number of rows per table, number of
rows returned by queries or size and complexity of queries, etc.
• CIS benchmark [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] – is a set of security benchmark for the MS SQL Server. These
benchmarks provide a testing tool to evaluate these database systems against
common security vulnerabilities. Generally, while installing databases most
administrators focus on key operating performance issues such as scalability, load balancing,
failovers, availability, etc. and let security settings to be default factory settings.
• Yahoo! Cloud Serving Benchmark [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] – is a program suite that is used to compare
the relative performance of NoSQL database management systems. The main goal
of benchmark is to facilitate performance comparison of transaction-processing
workloads which differed from ones measured by benchmarks designed for more
traditional DBMSs. YCSB was contrasted with the TPC-H as YCSB is used for big
data benchmark while TPC-H is a decision support system benchmark.
      </p>
      <p>Nevertheless, previously mentioned benchmarks are not suitable for data
matching measurement. The main problem is that we need to measure big data and decision
operations on both SQL and NoSQL DBMS’s it one program. Another problem is
that we do not know data schemas of the matching objects completely because it
may change during application using. In addition, those objects require different
processing methods for different substructures. These facts make the development of
your own benchmark relevant. The definition of data storage structures is needed for
this purpose.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Benchmark Building</title>
      <p>
        While implementing a benchmark, we consider Friend of a friend (FOAF) models as a
base for our complex object representation. FOAF describes the world using simple
ideas inspired by the Web [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In FOAF descriptions, there are only various kinds of
things and links, which we call properties. The types of things we talk about in FOAF
are called classes. FOAF is therefore defined as a dictionary of terms, each of which is
either a class or a property. Other projects alongside FOAF provide other sets of classes
and properties, many of which are linked with those defined in FOAF.
      </p>
      <sec id="sec-3-1">
        <title>Definition of operations with complex objects</title>
        <p>Complex object operations and requests are ones that can be made to specific objects
with high probability. For the benchmark, we define the following list of operations
based on FOAF object.
─ Find object by a set of FOAF properties;
─ Find objects by FOAF property with restrictions;
─ Find an object by special property and value;
─ Find similar objects.</p>
        <p>Three groups can generalize these use cases:
1. Finding an object by certain property or group of properties;
2. Finding an object by word or phrase occurrence in property;
3. Finding a similar objects, according to all properties.</p>
        <p>For the first group it is advisable to use simple property search with property value
selection by conditions, united by logical “and”, which is integrated into DBSM toolkit.</p>
        <p>For the second group fuzzy search is the most suitable. This search type intended to
preserve mistakes that are made because of the user’s misprint. The search is proceeded
by the entered request first, and then by several similarly written requests.</p>
        <p>For the third group comparison on calculating generalized estimates is the most
suitable. Working principle of this method is in calculating general estimate for the whole
object based on local properties’ estimates. Then the most appropriate objects are
selected by comparison of objects’ general estimates.</p>
        <p>To make a proper program that is worked with complex objects it is needed to
analyze the requests execution speed on different database sizes and models. Benchmark,
measuring time spent on a single operation should be programmed to get this
information.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Data models definition</title>
        <p>As we have different DBMSs’ with different logical and physical data models we need
to determine most general data models but with their specifics. As FOAF models are
the base for our complex objects, it is suitable to use data models containing full
information about storing them. The developed data model should describe the set of object
fields for each object in the database.</p>
        <p>Three main data models have to be implemented in each test in order to compare
DBMS’s performance in similar situations. Nevertheless, there can be additional
structures to show DBMSs’ unique features, according to their specific.</p>
        <p>1. Field data model – each object property has its own database object, containing
the property value and root object identifier (see Fig. 1).
2. Key-value data model – each record in database is key-value pair, where the key
is the name of object property and value is the value of this property for a
particular object. Also, the identifier of the root object is added to this record to
provide connection of the key-value pair with the root object. The example of
this structure can be seen in Fig. 2.
3. Tuple data model – each object has its tuple, contains key-value pair for each
object property. This tuple also stored with a root object identifier (see Fig. 3).</p>
        <p>
          Performance measurement has to be done for three different database storage model
they are relation, graph and document-oriented. The most common DBMS in their
segments are PostgreSQL [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], Neo4j [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] and MongoDB [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] were chosen for analysis.
        </p>
        <p>Two more data storage structures were added to the test according to selected DBMS
specific.</p>
        <p>4. Json data model – PostgreSQL has a special jsonb type for work with json
objects. It stores it in the parsed binary format that helps to speed processing up.
Resulting json in the database consists of key-value pairs for each FOAF
property. Fig. 4 is an example of how data stored in json</p>
        <p>Fig. 4. Data stored in json
5. Connected graph data model – connection to root project is provided by edges
with property key-value pairs, making connected tree to particular property
value. How data is stored in a graph is shown on Fig. 5.
The table below shows data models distribution across the selected DBMSs.
Three modules “Test PostgreSQL”, “Test Neo4j”, “Test MongoDB” were implemented
for performance measurement of DBMS. According to program specific, each test
should implement three main object operations. The special interface should be created
for this purpose, to make operation implementation in each test’s class necessary. Class
subject area diagram is shown on Fig. 6.</p>
        <p>The diagram represents following classes:
─ Test – interface, containing main operation for performance measurement
description;
─ App – test launcher class;
─ TestPostgreSQL – performance test implementation for PostgreSQL DBMS;
─ TestMongoDB – performance test implementation for MongoDB DBMS;
─ TestNeo4j – performance test implementation for Neo4j DBMS.</p>
        <p>All test classes contain three general methods that were declared in Test. These
methods are: seed – is used for generating random information and save it to selected
database; search – is used for calling all search-methods in class; clean – is used to
delete all test data from the database after a test run.</p>
        <p>Each class also has specific methods used for searching data. Search queries are
depended on data model presented in testing database. For example, search methods are:
testSearchByTuple, testSearchByKeyAndValueInRelations, testSearchSingleRepo.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Benchmark Results</title>
      <p>Performance test starts after launching the benchmark’s code on all described DBMS
and includes tests with 1000, 10000, 100000 records in the database. During each
iteration, a random data, generated by Java Faker library, added to the database. Each
added object has seven main fields of FOAF representation. They are: name, surname,
address, email, gender, interests, education. The example of the database object is on
Fig. 7.
- tests: Array
- context: context
+ startTests()</p>
      <p>TestNeo4j
- driver: Driver
- rand: Random
+ clean ()
+ search (db: String?)
+ seed (db: String?)
- testSearchByValue(n:
int)
testSearchByKeyAndValu
e(n: int)
- testSearchByTuple(n:
int)
testSearchByKeyValueInR
elations(n: int)
bulkGenerate(timeMeasu
rer: timeMeasurer, n: int)</p>
      <p>TestMongo
- repo:
RecordRepository?
- KeyRepo:
KeyRecordRepository?
- tupleRepo:
TupleRepository?
- rand: Random
+ clean ()
+ search (db: String?)
+ seed (db: String?)
- testSearchSingleRepo(n:
int)
testSearchSingleKeyRepo
(n: int)
- testTupleRepo(n: int)
testSearchDoubleRepo(n:
int)
bulkGenerate(timeMeasu
rer: timeMeasurer, n: int)</p>
      <p>TestPostgreSQL
- data_session: Session
- rand: Random
lates to described data models. In Table 2 this relation are set.</p>
      <p>As it is seen from the table, PostgreSQL requires more time to seed information in
the database, but it has the best results in searching scenarios on every tested database
size. The PostgreSQL loss on seeding information is not critical, as in real application
it is impossible to get such load in a small period of time, the database size will grow
constantly.</p>
      <p>According to this research PostgreSQL and tuple data storage structure are the most
suitable for developing complex object matching system.
This work is in progress. In the future, we will extend a number of operations with data
and will change model structures. In addition, some additional matching specifics
operations will be added. One of the issues, which is not considered in this paper, is
benchmarking of big volumes of data in a computational cluster. In that case, huge difference
in performance results might be found. This part we also will consider in further work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. TCP benchmark description, http://www.tpc.org/information/benchmarks.asp,
          <source>last accessed</source>
          <year>2019</year>
          /05/27
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. Benchmarks description, https://www.cse.wustl.edu/~jain/cse567-08/ftp/db/index.html,
          <source>last access 2019/05/30</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Bristlecone, https://github.com/shutterstock/bristlecone/tree/master/src/com/continuent/bristlecone/benchmark, last access
          <year>2019</year>
          /05/30
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. CIS benchmark, https://www.cisecurity.org/cis-benchmarks/,
          <source>last access 2019/05/30</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Yahoo! Cloud Serving Benchmark, https://github.com/brianfrankcooper/YCSB, last access
          <year>2019</year>
          /05/30
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. FOAF specification, http://xmlns.com/foaf/spec/,
          <source>last accessed</source>
          <year>2019</year>
          /05/27
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. PostgreSQL documentation, https://postgrespro.ru/docs/postgresql, last accessed
          <year>2019</year>
          /03/19
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Cypher documentation, https://neo4j.com/docs/cypher-manual/current/, last accessed
          <year>2019</year>
          /03/19
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. MongoDB documentation, https://docs.mongodb.com/manual/,
          <source>last accessed</source>
          <year>2019</year>
          /03/19.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>