© Screek Workshop

RedditFacebookXYouTube
Screek Workshop
/
NEWS
/[SCREEK Blogs]Using the MariaDB Add-on as the database backend to replace the default SQLite seems like a solid way to improve long-term history performance.
[SCREEK Blogs]Using the MariaDB Add-on as the database backend to replace the default SQLite seems like a solid way to improve long-term history performance.
[SCREEK Blogs]Using the MariaDB Add-on as the database backend to replace the default SQLite seems like a solid way to improve long-term history performance.

[SCREEK Blogs]Using the MariaDB Add-on as the database backend to replace the default SQLite seems like a solid way to improve long-term history performance.

Date
Apr 22, 2026 3:21 AM
Sensors
BLOGS

As we continue building and testing multiple types of DIY sensors every day, we started noticing slowdowns when analyzing longer time ranges of data. We’ve learned that Home Assistant can deliver impressive results if you’re willing to explore and optimize it. So we switched the database backend to MariaDB. From our initial experience (day 1), with dozens of test sensors running, the overall performance already feels noticeably faster. We’re looking forward to seeing how it performs over the long term.

🧪Using MariaDB as the backend for historical records

  • Set a database user password in the MariaDB add-on
  • image
  • Add the connection string to Home Assistant configuration
  • image
  • Restart Home Assistant Core (no need to reboot the entire system)

😊Some other experiences

  • Migrating the database will result in the loss of old records; if you remove the recorder entry from the configuration.yaml file, the segments will revert to the original database.
  • Even if the database encounters an error, your HA will not fail; it will simply enter a state with no history.
  • The actual database files can be accessed within the MariaDB container, or viewed on the host machine by accessing /mnt/data/supervisor/addons/data/core_mariadb with root privileges.
  • ➜  ~ docker exec -it addon_core_mariadb bash
    core-mariadb:/# du /data -h
    70.7M   /data/databases/homeassistant
    3.8M    /data/databases/mysql
    608.0K  /data/databases/sys
    8.0K    /data/databases/performance_schema
    177.6M  /data/databases
    177.6M  /data
    Here, the database occupies 70.7 MB of space.
  • If something goes wrong, you’ll know quickly If the setup fails, Home Assistant will report that the Recorder integration failed to start, and several dependent components may also fail — similar to what’s shown in the screenshot.
  • image
  • Default MariaDB settings are conservative The add-on allows you to append startup parameters. Increasing values like buffer sizes can improve performance, but comes with trade-offs (mainly higher RAM usage).
  • Performance vs SQLite (early impression) So far, MariaDB feels noticeably more responsive than SQLite in our testing scenario.
  • Storage usage inspection You can inspect disk usage via:
    • Advanced SSH add-on (Disable Protected Mode, no need for full root access)
    • docker images and related commands
    • image
  • Monitoring memory usage Tools like Glances provide a convenient way to:
    • Monitor real-time memory usage
    • Sort processes by memory consumption
    • image

📊 Real-world testing

The chart below shows our latest comparison data from THS4x sensors.

So far, the UI feels very smooth even with high-frequency data.

image