Since 2016, I’ve had a fileserver mostly just for backups. System is on 1 drive, RAID6 for files, and semi-annual cold backup.

I was playing with Photoprism, and their docs say “we recommend placing the storage folder on a local SSD drive for best performance.” In this case, the storage folder holds basically everything but the pictures themselves such as the database files.

Up until now, if I lost any database files, it was just a matter of rebuilding them by re-indexing my photos or whatever, but I’m looking for something more robust since I’ll have some friends/family using Pixelfed, Matrix, etc.

So my question is: Is it a valid strategy to keep database files on the SSD with some kind of nightly backup to RAID, or should I just store the whole lot on the RAID from the get go? Or does it even matter if all of these databases can fit in RAM anyway?

edit: I’m just now learning of ZFS caching which might be my answer.

  • one_knight_scripting@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 hours ago

    Hah. I see your looking into ZFS caching. Highly recommend. I’m running Ubuntu 24.04 Root on ZFS RAID10. Twelve each data drives and one nvme cache drive. Gotta say it’s performing exceptionally. ZFS is a bit tricky, it requires an HBA not a RAID card. You may to to flash the raid card to get it working like I did. After that, I have put together a GitHub for the install on ZFS RAID 10, but you should easily be able to change it to RAIDz2. Fair warning, it wipes the drives entirely.

    https://github.com/Reddimes/ubuntu-zfsraid10/

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 hour ago

      Picked up a LSI SAS 9305-16I. I was always planning to do software raid, so I think it’ll do the trick for zfs.

  • MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 hours ago

    Both your RAID and NVMe data should be getting backed up daily to 2 different destinations, if it’s irreplaceable.

    But to answer your question, just place the DB and cache files for Photoprism on the NVMe, and the photos themselves on the RAID.

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 hour ago

      Can you suggest a method for two-destination daily backups that don’t involve a 3rd party service? At the moment, I’m doing every six months or so on two sets of cold storage, one offsite.

      • MangoPenguin@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        That sounds reasonable, although I’d be worried about not having an extra local daily backup in case files get corrupted or accidentally deleted.

  • blackstrat@lemmy.fwgx.uk
    link
    fedilink
    English
    arrow-up
    4
    ·
    9 hours ago

    RAID gives you greater uptime. That is all. You should also have backups. So how much uptime do you need?

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      59 minutes ago

      I’ve heard that too. Hmm.

      Up until recently, the server mostly hosted a photo library and media library that didn’t tend to change very often. So a hdd in a fireproof save updated once a year was enough for me.

      I guess I’ll have to come up with a better solution. What would you recommend for automatic backups? I’m trying to avoid 3rd party services.

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    14 hours ago

    You may be confused about the terminology:

    RAID = many disks that help prevent data loss

    NVME = Just an SSD

    A collection of drives that are joined to a RAID group prevent data loss. An NVME drive is just a drive, which has no data loss prevention. If that drive dies, the data dies.

    If those docs say anything about SSD, it’s because their code is slow, and it will seem less obvious by using a faster disk.

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      14 hours ago

      I understand all of that. Sorry I didn’t explain it well.

      I have a RAID6 for data and a single HDD for system files. I’d like to move the HDD to an NVME/SSD. I suppose I could make another RAID with an additional NVME, but I’ve found it easier to deal with booting off a traditional drive.

      My solution for redundancy for the NVME is to just backup the bits that I need every night. These are usually just a few hundred megabyte database files. I’m curious if that’s a typical solution.

      edit: to clarify, it’s a software raid with mdadm.

      • farcaller@fstab.sh
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        11 hours ago

        I just made a mirror out of two NVMes―they got cheap enough not to bother too much with the loss of capacity. Of course, that limits what I can put there, so I use a bit of a tiered storage between my NVMe and HDD pools.

        Just think in terms of data loss: are you going to be ok if you lost the data between backups? If the answer is yes, one NVMe is enough.

        • ch00f@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          11 hours ago

          Yeah, I’m only serving one timezone, so if I can swing nightly backups at periods of low activity, I’d only be out 1 day which isn’t that big.

  • tal
    link
    fedilink
    English
    arrow-up
    3
    ·
    13 hours ago

    Note: If you want to backup a DBMS, you’re going to want to use some system that ensures that the backup is atomic.

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      13 hours ago

      Can you elaborate? (learning a lot at the moment).

      My thought was to just copy over the whole database directory every night at like 2am. Though some of the services do offer built-in database backup tools which I assume are designed to do what you’re talking about.

      • MalReynolds@slrpnk.net
        link
        fedilink
        English
        arrow-up
        2
        ·
        13 hours ago

        Basically, you want to shut down the database before backing up. Otherwise, your backup might be mid-transaction, i.e. broken. If it’s docker you can just docker-compose down it, backup, and then docker-compose up, or equivalent.

        • pcouy@lemmy.pierre-couy.fr
          link
          fedilink
          English
          arrow-up
          2
          ·
          11 hours ago

          Alternatively, if your databases are on a filesystem that supports snapshots (LVM, btrfs or ZFS for instance), you can make a snapshot of the filesystem, mount the snapshot and backup thame database from it. This will ensure the backup is consistent with itself (the backed up directory was not written to between the beginning and the end of the backup)

  • haui@lemmy.giftedmc.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    13 hours ago

    I‘m building this for some time now. I run a raid 1 on mechanical disks for file storage and have an ssd for the logic/database stuff. Have bought a second ssd and will put them in a raid as well bc limited lifespan.

    • ch00f@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      13 hours ago

      Hm… My new motherboard does actually have dual NVME M.2 slots. I might end up doing that (once my budget recovers a bit).

      • haui@lemmy.giftedmc.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 hours ago

        You dont even need special nvme‘s. You can buy mid range ones.

        Best is if they dont fail together so they should best not be the same batch or have the same age and write amount.

        I do highly recommend to have a raid array for any server ssd since they fail unpredicably and without any signs.