Installing a DBMS on Odroid N2

MariaDB Database

Tue, 15 Oct 2019

In looking for the best possible performing DBMS system for the odroid N2, I ran some single thread tests between PostgreSQL and MySQL and was surprized to learn that MySQL was over twice as fast as PostgreSQL, delivering 1000x simple select by id requests in 2.3 seconds compared to progreSQL at 4.8 seconds per 1000 reqests. Although I preferred PostgreSQL I decided to install a fork of MySQL, called MariaDB which is written by the original creator of MySQL. In latter versions, MariaDB allows multiple connections to be handled by each thread which should reduce resources when the database is being accessed by multiple connections.

Unfortuantely the latest arm version of MariaDB hasn’t been packaged for installation in ubuntu so I had to download the source of MariaDB and compiled it directly on the N2 by following instructions written on another blog here. It took 2-3 hours to compile MariaDB on the N2 and wasn’t smooth sailing. But by the end of the day I had version 10.3.8 loaded with a database for testing.

I also wanted to move the MariaDB data directory (and the web directory) to a SSD drive to increase database performance but MariaDB refused to start with the newly assigned data directory. MariaDB wasn’t being restricted by Apparmor (which can also cause problems) so in the end I mounted the SSD drive to serve the original directory of MariaDB using etc/fstabs…

UUID=15BCB58053D4F348 /var/www ntfs-3g auto,users,permissions 0 0 UUID=3667255D397353F5 /var/lib/mysql ntfs-3g auto,users,permissions 0 0

Multithreaded Performance

In a multithreaded Lazarus pascal application using zeos network library I was able to achieve 2,500 requests a second (10 threads using 10 connections) from MariaDB on the Odroid N2. For comparison, a similar test on I7 3770 with postgreSQL achieved 15,000 requests a second. So even though the N2 doesn’t perform as well as an I7, its performance is more than enough to serve a well written CRUD application that only serves a hundred or so users.

unsplash.com

GUI client for MariaDB

MySQL Workbench is a good GUI client written for MySQL by Oracle. Because MariaDB has changed somewhat from from original fork of MySQL it’s not 100% compatiable but still works well enough given there isn’t any other free gui client available that works under the arm64.

Conclusion

MariaDB is a great database system for Arm Architecture for developers needing a bit more functionality than SQLite.

Loading...