Mysql configuration and power failure
The setup for maximal resiliency from power failure is to have 3 Galera nodes, one in each of three geographically separate locations.

You seem to be using MariaDB, the newer versions of which include Galera Clustering.  There is, of course, some setup for clustering and some coding/admin differences than vanilla MariaDB.

When a node (or even the entire datacenter it is in) goes down, the other nodes are available to take reads and writes.  The only issue is pointing your clients to them.  There are several Proxy servers (etc) that provide this.

3 is a magic number.  It allows for a single-point-of-failure, with the other 2 nodes voting to say "we have a quorum" and will stay up.  The one that went down might actually be alive, but hidden behind a network outage.  To prevent "split brain", that node realizes that id does not have a quorum, so it refuses to take writes, since they might compromise the consistency of unique keys.

For a single 'home' system:


Use InnoDB, not MyISAM.  InnoDB will recover graceful from power failures.
Plug into a UPS.  This will give you 'some' time before the power really fails.
Use a laptop, not a desktop -- laptops have a battery that will last 'some' time.