Hello self-hosters! :) I’d like to tap into your experience

tl;dr: Is it really a bad idea to use MariaDB with data over NFS?

My setup

  • RAID NFS NAS on RPi4
  • “CPU machine”, just an old laptop for now

The idea is that NAS stores the data and RAID mitigates single point of failure. Laptop is only for running the stuff, all docker-compose are under git, uploaded elswhere. Laptop fails - I buy a new refurbished one and put everything back together from data on NAS and git

Problem

But Nextcloud uses DB. ATM it sits on the laptop. And I’m thinking how to somehow move that data to the NAS.

At the beginning NAS was just for NC files, connected as NC “external storage” over SFTP. But there were issues with this setup and NFS4 turned out to not require Kerberos to work.
Since NFS docker volumes have been working quite fine, I thought about just moving the data to the NAS. But then I read this:

Generally, we recommend not to use NFS (Network File System) with MariaDB, for these reasons:

  • MariaDB data and log files on NFS volumes can become locked and unavailable for use. Locking issues may occur in cases where multiple instances of MariaDB access the same data directory, or when MariaDB is shut down improperly, for instance, due to a power outage. In particular, sharing a data directory among MariaDB instances is not recommended.

  • Data inconsistencies due to messages received out of order or lost network traffic. To avoid this issue, use TCP with hard and intr mount options.

And I feel discouraged

  • I could move whole DB (I mean including the process) to the NAS, but then operating the DB becomes NAS’ burden and breaks the responsibility separation
    I’m not a fan of this idea
  • I could treat NAS as first stage of backup for that DB data and just send the data to NAS once a day
    Also a bit meh. Getting back up from server failure will require copying the data
  • Maybe it’s not that bad to use MariaDB with NFS?
    If there is a problem with server-NAS connection, I actually don’t want Nextcloud to work at all. It should fail, so I know I need to fix something

So, what are your experiences? Is running the DB on one machine, using the data from another machine over NFS a shot in the foot?

  • ShellMonkey@piefed.socdojo.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    11 hours ago

    Borg is its own thing, just handy to have it built in and preconfigured to work. If you run VMs on your working host instead of running NC directly on the machine you could just back those up for pretty much the same effect, though it wouldn’t usually be a realtime backup.

    The next cloud data is fine being remote, when I say realtime I guess it could be better said as time sensitive. A database needs to update something and read it back in the right sequence for it to work properly. Just retrieving a file doesn’t have those issues.

    If you happened to use it in a way like shared collaboration of a document with realtime updates it might be an issue, but I expect in that case the revisions would hit the DB first and then be put to the file as a secondary operation. Never tried that myself though.