Analysis and future development of the sensor data storage of an IoT application
Loading...
URL
Journal Title
Journal ISSN
Volume Title
Perustieteiden korkeakoulu |
Master's thesis
Unless otherwise stated, all rights belong to the author. You may download, display and print this publication for Your own personal use. Commercial use is prohibited.
Authors
Date
2020-10-20
Department
Major/Subject
Computer Science
Mcode
SCI3042
Degree programme
Master’s Programme in Computer, Communication and Information Sciences
Language
en
Pages
70
Series
Abstract
An increasing number of sources from IoT to monitoring generate time-series data. This thesis examines the data storage of an IoT system, which uses a MySQL database for storage. The system has a history of performance problems for operations on the sensor data, such as some database queries taking tens of seconds to execute. Also, the system is expected to start receiving significantly increased amounts of sensor data in the following years. For these reasons, there is considerable uncertainty in the performance of the current sensor storage in the future. This thesis is undertaken to examine what should be done to the data storage of the system to ensure it performs acceptably in the future. The objective of this thesis is to obtain a recommendation for the future development of the sensor system. More precisely, a list of suggestions that improve the performance of the system, and a time estimate for when they need to be implemented at latest is proposed. This recommendation is based on testing different data storage solution alternatives with the most essential use cases of the application, on future datasets. Three data storage solutions are tested: two improved MySQL solutions and a PostgreSQL solution with the TimescaleDB extension. The results demonstrate that the data of the sensor system can be feasibly stored in a modified version of the existing MySQL database at least until 2028, when the size of the dataset is over 700 GB. This is enabled by implementing optimizations such as partitioning the sensor data and pre-calculation of data for performance-intensive queries. The recommendation is to implement these optimizations on the current MySQL database as soon as possible, but at latest at the start of 2021, when the number of slow queries was perceived to start growing rapidly. The PostgreSQL and TimescaleDB solution did not yield further performance gains, and is therefore not recommended for this system.Suuri määrä erilaisia sovelluksia IoT:sta monitorointiin tuottaa aikasarjadataa. Tämä diplomityö tutkii erään IoT-järjestelmän sensoridatan tallennusta. Tällä hetkellä järjestelmän sensoridata tallennetaan MySQL-tietokantaan, jonka suorituskyky on paikoin ollut epätyydyttävä. Esimerkiksi joidenkin tietokantakyselyiden suoritusaika on ollut kymmeniä sekunteja. Lisäksi järjestelmän sensoreista kerättävän tietomäärän odotetaan kasvavan huomattavasti lähivuosina. Näistä syistä järjestelmän tiedontallennusratkaisun oletetaan olevan riittämätön tulevaisuudessa. Tämä työ tehtiin, jotta voitaisiin selvittää ratkaisuja, joilla järjestelmän tiedon tallennus saataisiin toimimaan riittävän nopeasti tulevaisuudessa. Tämän työn tavoitteena on antaa suositus tutkittavan järjestelmän sensoridatan tallennuksen jatkokehityksestä. Suositus koostuu muutoksista, jotka parantavat järjestelmän suorituskykyä, ja niiden toteuttamisen aika-arviosta. Suositus perustuu työssä tehtäviin testeihin: erilaisia tiedontallennusvaihtoehtoja testataan järjestelmän ennustetuilla tulevaisuuden tietomäärillä, käyttäen mittareina järjestelmän keskeisten käyttötapausten tietokantakyselyiden suoritusaikoja. Testit tehdään kolmelle tallennusvaihtoehdolle: kahdelle eri tavoin parannellulle MySQL-versiolle, ja PostgreSQL-versiolle, jossa on käytössä TimescaleDB-lisäosa. Testien tulokset näyttävät, että IoT-järjestelmän sensoridata voidaan tallentaa jo käytössä olevaan MySQL-tietokantaan ainakin vuoteen 2028 saakka, jolloin tietomäärä on yli 700 GB. Tietokantaan tehdyt parannukset, kuten sensoridatan partitionti ja hitaiden kyselyiden tuloksien esilaskenta mahdollistavat tämän. Tuloksien perusteella nämä parannukset suositellaan otettavaksi käyttöön mahdollisimman pian, kuitenkin viimeistään vuoden 2021 alkuun mennessä, jolloin hitaiden kyselyiden määrän nähtiin kasvavan huomattavasti. Testattu PostgreSQL ja TimescaleDB -ratkaisu ei tuonut lisäsuorituskykyä MySQL-versioihin verrattuna, joten siihen siirtymistä ei suositella.Description
Supervisor
Vuorimaa, PetriThesis advisor
Laine, OlliKeywords
sensor data storage, time-series data storage, relational databases, mysql, postgresql, timescaledb