I'd like to know if there are certain configurations of Mysql that should be considered to keep the effect of the power failure as low as possible. Which configuration points should be noted and what values should they have.
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.
This setting will provide the best protection from data loss in case of power failure when DB transactions are being performed. I am assuming you are using
innodb engine. This will protect committed transactions.
On the other hand, you mentioned it is your home PC so probably not being used in production. So what are your concerns about data loss? Must be all test data anyway, no?