<!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>DBMS Performance Issues on a Single-Board Computer Raspberry Pi 3 Model B</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>ITMO University</institution>
          ,
          <addr-line>St. Petersburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>0000</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>In this article, using the Raspberry Pi 3 Model B platform as an example, we consider the problem of performance of different DBMS in the process of using them to provide a single board computer as a web server. The existing studies do not reveal the database management system (DBMS) performance problems on single board computer platforms. A comparative analysis of the performance of different operations using MariaDB relational DBMS and the same operations using MongoDB NoSQL DBMS was conducted. The data for the analysis were obtained in the process of experiment, during which the performance of such operations on databases as sampling and updating was tested. The Node.js. platform was used as a testing application. Testing was carried out on a test stand that included a single board computer Raspberry Pi 3 Model B and Windows PC. Besides the DBMS, the web server performance analysis was conducted in conjunction with the file system. As a result of the testing, the real performance degradation was found to be compliant with the expected one and some interesting performance features of different DBMS were identified. As a result of the testing the conclusions were made about the possibility of using Raspberry Pi 3 Model B platform as an authentication webserver.</p>
      </abstract>
      <kwd-group>
        <kwd>Single-board computers</kwd>
        <kwd>Raspberry Pi</kwd>
        <kwd>Database Management Systems</kwd>
        <kwd>MySQL</kwd>
        <kwd>JSON files</kwd>
        <kwd>MongoDB</kwd>
        <kwd>Node</kwd>
        <kwd>js</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>At the moment, among the most important requirements for hardware and technical
solutions are mobility, scalability, low operating costs and the possibility of
customization. These qualities have led to the spread of single-board computers in a number of
areas, including the routing of network requests, management of components of the
Internet of Things, the deployment of software-controlled hardware and software
solutions in the field.</p>
      <p>The study showed that up to 85% of solutions based on single board computers tend
to implement monolingual paradigm, mainly based on the programming language C.
The monolingual platform is understood as the management of all or almost all aspects
of the platform's operation using the same programming language. For example, a one
programming language can be used to control sensors and LEDs on a computer as well
as to process the data from these sensors and deliver them to the IoT client, e.g. via a
web server. However, the evolution of JavaScript and the development of its ecosystem
create reasons for the migration to this language as the basis of the monolingual
platform. Refactoring of the existing code and practical experience allowed us to identify
a number of related problems.</p>
      <p>In the previous studies, one of the authors needed to ensure the performance of the
web server when working with the database to avoid problems with data transmission
to the client side and their reflection. In the course of this work relational DBMS
MySQL was selected. This choice was due to the convenience of using the relational
data model and the wide popularity of the database. At application deployment
developed during work on final qualifying work on platform Raspberry Pi the problem of
absence of the official distribution kit of server MySQL has been revealed. This fact
revealed the need to replace the MySQL database with another one that supports the
work on a single-board computer Raspberry Pi. DBMS such as MariaDB and
MongoDB were considered as possible options. In addition to comparing the results of using
the DBMS, a performance comparison was made when using JSON file stored in the
file system as a database. This choice was conditioned by the necessity to check the
ability of the file system or hardware data storage to avoid reducing the working speed.</p>
      <p>
        MariaDB relational database surpasses MySQL performance by 3-5% due to
improved query optimizer and many other performance related improvements, as well as
complete drop-in-replacement MySQL 5.5, which is a strong argument for analyzing
the performance of this particular database on the Raspberry Pi platform [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        At the same time, the article A Comparison of Database Performance of MySQL and
MariaDB with OLTP Workload v3.0. states that MySQL performance is higher than
MariaDB performance when using approximately the same amount of system resources
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. On the other hand, the article NVM Aware MariaDB Database System states that
MariaDB has implemented a solution that increases the efficiency of using this DBMS
on systems with non-volatile memory [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Also, the article by Yusuf Abubakar shows
that MariaDB relational DBMS is the most productive for data reading operation among
all considered relational DBMS such as PostgreSQL, MySQL and SQLite [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Thus,
there are a lot of articles considering MariaDB relational DBMS performance that do
not come to a final solution of the issue of positioning this DBMS in the relational
DBMS performance rating.
      </p>
      <p>
        There is also a question of the rationality of MongoDB use considering the
disadvantages of this DBMS in the form of a large load on the system's RAM and the need
to independently interrupt slow queries [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. At the same time, the ability to easily scale
MongoDB [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] can provide the use of the cluster of Raspberry Pi 3 Model B instances
as the hardware part of the distributed database created by MongoDB No-SQL DBMS.
      </p>
      <p>
        Since the study considers the DBMS performance on the Raspberry Pi 3 Model B
platform, the use of the classical criterion of the number of operations for a certain
period of time, such as in the article on the creation of the LinkBench benchmark [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
seems irrational due to the fact that single-board computers are worse than specialized
data storage systems all performance parameters, the time spent on one operation of
selecting or updating data is used as a comparison criterion for a DBMS.
      </p>
      <p>
        Despite the presence of the conducted researches on the topic of comparing the
performance of relational DBMS MySQL and NoSQL DBMS MongoDB [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] or other
relational DBMS PostgreSQL and MongoDB [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], it can be noted that these researches
did not consider the issue of DBMS data performance on single-board computer
platforms.
2
2.1
      </p>
    </sec>
    <sec id="sec-2">
      <title>Data mining</title>
      <sec id="sec-2-1">
        <title>Test bench specification</title>
        <p>The following DBMS testing platforms were selected: Windows PC and Raspberry Pi
3 Model B single board computer. These platforms are widely used in various areas of
application development. While the PC has the best hardware features, Raspberry Pi 3
Model B is compact, low power consumption and low cost. The need for tests on a
desktop PC was due to the possibility that a single-board computer Raspberry Pi 3
Model B might not have enough performance, so that the use of single-board computers
to deploy web servers within the concept of monolingual programming using the
JavaScript language would be irrational. Thus, it became necessary to determine an
acceptable threshold for performance degradation. For this purpose, the hardware
characteristics of desktop PC and Raspberry Pi 3 Model B were compared. SSD on Windows
PC and MicroSD card on Raspberry Pi 3 Model B were used as a data storage. MicroSD
card used as read-only memory in Raspberry Pi 3 Model B by default. A comparison
of all components of the platforms used is shown in Table 1. As a result of the
comparison, it was decided to establish an acceptable threshold performance reduction of
200%.
comparison. This criterion was chosen due to the need for fast data exchange between
the DBMS and the server.</p>
        <p>The process of experimenting to determine a suitable DBMS was organized as
follows. Tests were developed to determine the timing of operations. In addition, data
similar to the real data had to be generated. The data could be used to fill various
database management systems, in two versions. In the first case, 20,000 records were used.
This number is due number is due to the one of the author's previous researches, in
which a database of about 20,000 unique people was used. Thus, the choice of this
number allows to estimate the DBMS indicators that can be used to assess their
performance in real life tasks. The second option contained 100,000 entries. The choice of
such a number of records is based on the possibility of increasing the number of records
in the existing database, according to experts' estimates, up to 100,000 in 3-5 years.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Relational DBMS MariaDB testing</title>
        <p>To test the data access performance in relational DBMS MariaDB, the samples were
made by the year of birth and by the surname. Such samples allowed to test the selection
as a large set of values and a less one from the volume data array. The code fragment
responsible for sampling small amount of data from relational DBMS MariaDB is
shown in Figure 1.
Thus, in the case of small data set sampling, their filtration is performed by name, while
in the case of large data set sampling the filtration is performed by the birth year. A
sample code sample that selects a large amount of data is shown in Figure 2.
Also, the DBMS was tested for the data alteration speed. To perform this operation, we
decided to use the method of updating the data of one column, if the data of another
column correspond to the value strictly specified earlier. The code fragments
responsible for this part of the testing are shown in Figure 3.
The NoSQL DBMS MongoDB performance testing process is in general similar to the
MariyaDB relational DBMS performance testing process, except for a few points, such
as no need to format the SQL query to the DBMS and different DBMS connection
implementation. Thus, unlike the MariaDB client implementation, the MongoDB client
implementation, due to the fact that this DBMS supports queries to databases in
JavaScript language, uses built-in functions together with the built-in MongoDB functions.
The code that selects a small amount of data from the database is shown in Figure 4.
It follows from the code that the selection of large and small amounts of data differ
slightly both in queries to MariaDB DBMS and in queries to MongoDB DBMS. The
key difference between the queries to these DBMS is the use of SQL language in the
case of queries to MariaDB DBMS and the use of built-in functions in the case of
queries to MongoDB DBMS. The code responsible for selecting a significant amount of
data from the MongoDB is shown in Figure 5.
The procedure of updating data in the MongoDB DBMS differs significantly from
the procedures considered earlier. Firstly, there are several methods of data updating in
MongoDB first. They are given below in Table 2.</p>
        <p>Also, one of the operators in Update operation in MongoDB - $set - is used to
perform the data update request. The full list of operators and description of their behavior
is given below in Table 3.
Based on the above mentioned, the code was developed to update the data in the
MongoDB DBMS, which is shown below in Figure 6.
As a result of the code considered earlier it was possible to accumulate a large amount
of data. In total, more than 25 thousand data sampling and updating operations were
performed for all operations. The results of time measurements of these operations are
analyzed in the next section.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Data analysis</title>
      <p>From the data accumulated during the experiment, a simple non-repeatable sample was
built consisting of 3600 records of the time spent on data sampling and updating
operations in different DBMS on different platforms and operating systems. With the help
of statistical transformations, various data were obtained. Thus, for example, the data
on average values of the time spent on executing different operations in different
DBMS are given in Table 4.</p>
      <p>From the diagrams shown in Fig. 7 we can see that the time spent on operations with
the MongoDB DBMS deployed on a Windows PC is subject to the Laplace-Gauss
distribution. And in Fig. 8 it can be seen that the time spent on the same operations with
Raspberry Pi 3 Model B with the Ubuntu 18.04 operating system (Bionic) is subject to
the Poisson distribution.</p>
      <p>To test the hypothesis that the performance degradation on the Raspberry Pi 3 Model
B platform running Ubuntu 18.04 (Bionic) depends not so much on optimizing various
DBMS for this platform as on the platform performance itself, besides the table with
the average values of the time spent on executing the data sampling and updating
operations, the tables with its minimum and maximum values are given below. In Table 5
the minimum testing results is shown. The maximal testing results is shown in Table 6.
In the course of the study it was revealed that the problem of monolingual programming
on the Raspberry Pi 3 Model B platform using the JavaScript language, associated with
the lack of an official MySQL server distribution, is solved by using an alternative
database management system MariaDB. At the same time, the study showed that the use
of DBMS MariaDB leads to a decrease in performance by 111-216 percent. Thus, the
study found that the Raspberry Pi 3 Model B platform is not an effective choice for
working with databases, due to a significant decrease in database performance. At the
same time, the platform can be used effectively to deploy applications that do not
require high performance data storage and processing operations. For example, Raspberry
Pi 3 Model B can be used as an authorization server for web-based applications or as a
distributed DBMS cluster element.</p>
      <p>The current study has revealed a number of issues that will be the subject of the
upcoming research. In the future it is possible to investigate the issue of performance
of different DBMS on a cluster of some Raspberry Pi platforms, this study can
determine the importance of the Raspberry Pi platform for use in the development of
highload web applications.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Ivanov</surname>
          </string-name>
          , Ivan. (
          <year>2019</year>
          ).
          <article-title>Reasons to migrate to MariaDB</article-title>
          . [On-line] - https://www.researchgate.net/publication/331074421_Reasons_to_migrate_to_
          <source>MariaDB. Last accessed 26.01</source>
          .2020
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Stepovik</surname>
            <given-names>A. N.</given-names>
          </string-name>
          <article-title>Analiz preimushhestv i nedostatkov nereljacionnyh SUBD na</article-title>
          primere MongoDB //Nauchnoe Obespechenie Agropromyshlennogo Kompleksa.
          <article-title>-</article-title>
          <year>2018</year>
          . - S.
          <fpage>595</fpage>
          -
          <lpage>597</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Shichkina</given-names>
            <surname>Ju</surname>
          </string-name>
          . A.,
          <string-name>
            <surname>Kuprijanov</surname>
            <given-names>M. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koblov</surname>
            <given-names>A. A.</given-names>
          </string-name>
          <article-title>Sravnenie proizvoditel'nosti re-ljacionnyh i nereljacionnyh baz dannyh na primere MySQL i MongoDB //Informacionnye sistemy i tehnologii v modelirovanii i upravlenii</article-title>
          .
          <source>- 2017</source>
          . - S.
          <fpage>213</fpage>
          -
          <lpage>219</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>B.A.</given-names>
            <surname>Novikov &amp; M.Y.Levin</surname>
          </string-name>
          ,
          <article-title>"Sravnitel'nyi analiz proizvoditel'nosti SQL i NoSQL SUBD" [Comparative Analysis of the Performance of SQL and NOSQL DBMS]</article-title>
          ,Computer tools in education,
          <source>no.4</source>
          , pp.
          <fpage>48</fpage>
          -
          <lpage>63</lpage>
          ,
          <year>2017</year>
          (in Russian).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Tongkaw</surname>
            , Sasalak &amp; Tongkaw,
            <given-names>Aumnat.</given-names>
          </string-name>
          (
          <year>2016</year>
          ).
          <article-title>A comparison of database performance of MariaDB and MySQL with OLTP workload</article-title>
          .
          <volume>117</volume>
          -
          <fpage>119</fpage>
          .
          <fpage>10</fpage>
          .1109/ICOS.
          <year>2016</year>
          .
          <volume>7881999</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Lindström</surname>
            , Jan &amp; Das,
            <given-names>Dhananjoy</given-names>
          </string-name>
          &amp; Mathiasen, Torben &amp; Arteaga, Dulcardo &amp; Talagala,
          <string-name>
            <surname>Nisha.</surname>
          </string-name>
          (
          <year>2015</year>
          ).
          <article-title>NVM aware MariaDB database system</article-title>
          .
          <volume>10</volume>
          .1109/NVMSA.
          <year>2015</year>
          .
          <volume>7304362</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Abubakar</surname>
          </string-name>
          , Yusuf. (
          <year>2014</year>
          ).
          <article-title>BENCHMARKING POPULAR OPEN SOURCE RDBMS: A PERFORMANCE EVALUATION FOR IT PROFESSIONALS</article-title>
          .
          <source>International Journal of Advanced Computer Technology (IJACT)</source>
          .
          <volume>3</volume>
          . 39.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Armstrong</surname>
            , Timothy &amp; Ponnekanti, Vamsi &amp; Borthakur, Dhruba &amp; Callaghan,
            <given-names>Mark.</given-names>
          </string-name>
          (
          <year>2013</year>
          ).
          <article-title>LinkBench: a database benchmark based on the Facebook social graph</article-title>
          .
          <source>Proceedings of the ACM SIGMOD International Conference on Management of Data. 1185-1196. 10.1145/2463676</source>
          .2465296.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>MongoDB</given-names>
            <surname>Documentation</surname>
          </string-name>
          . [On-line] - https://docs.mongodb.com/.
          <source>Last accessed 26 January</source>
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>