Database inside Incus Container/VM - Backups?

What’s the best way to run a database such as Mariadb and manage backups?

  • send data to external cloud storage.
  • mount a custom incus volume to /var/lib/mysql
  • just keep backing up the container/vm
    What are the typical solutions used in production?

For a production setup I would have one master and at least one replica database configured or if you need higher availability setup a cluster. Having /var/lib/mysql on a separate storage volume is recommended as it has a few advantages compared to have a single image where everything sits on.

Having replication doesn’t mean you don’t need a backup solution.

  • one option is to perform regular snapshots (if your storage driver supports it) and replicate it to a different location, ZFS for example
  • use one of the many backup scripts which do hourly, daily, weekly etc. dumps to a local storage and copy this away

Point I want to make is separate your data from the OS allows much better flexibility to perform upgrades, backups etc.

Hope it helps a bit