Skip to content

lmagyar/homeassistant-addon-mariadb-inmemory

Repository files navigation

Home Assistant Custom Add-on: In-memory MariaDB

In-memory MariaDB database for Home Assistant.

Warning

This is a fork of the official add-on!

This version uses tmpfs to store MariaDB databases in-memory. If you are trying to minimize your SD-card's wear, give this add-on a try.

Even this is an in-memory database, it can automatically export (from memory to SD card) all database's content during backup, update, restart or even periodically, and can automatically import (from SD card to memory) the content when the add-on starts again. The exported database (an SQL file generated by sqldump) is gzip-ed before written to the storage to minimize SD-card wear.

Though it won't protect you from power failures completely. After a power failure, when the add-on is restarted, it will import the last known exported database content. So when eg. daily periodic export (from memory to SD card) is enabled, you will loose the latest sensory data within that day, but your long term statistics information will remain mostly intact:

Long term statistics from an in-memory database

The other notable difference is that the add-on purges old statistics data from the database. By default, Home Assistant never deletes statistics data. This means that over time the size of the database would grow beyond the memory limit.

Warning

GitHub Release Last Updated Reported Installations Project Stage License

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture

Github Actions Project Maintenance GitHub Activity

About

You can use this add-on to install an in-memory MariaDB, which is an open-source (GPLv2 licensed) database. MariaDB can be used as the database backend for Home Assistant. For more information, please see MariaDB

Installation

  1. Navigate in your Home Assistant frontend to Settings -> Add-ons -> Add-on Store.
  2. In the ... menu at the top right corner click Repositories, add https://github.com/lmagyar/homeassistant-addon-mariadb-inmemory as repository.
  3. Find the "In-memory MariaDB" add-on and click it. If it doesn't show up, wait until HA refreshes the information about the add-on, or click Check for updates in the ... menu at the top right corner.
  4. Click on the "INSTALL" button.

Documentation

For more details, please see the add-on's Documentation pages.