Best practice for backup / snapshot applications while running

I am looking for best practices for creating snapshots/backups of applications, and I have a specific question about making snapshots. What has become clear to me already is that it’s advisable to use a separate dataset for each application, so that individual applications can be restored via snapshot without affecting other applications. What is the effect if an application is active (and data is being written to files or database) when the snapshot is taken?

I also read advice (not TrueNAS related) to stop Docker containers before making a backup. How does this relate to applications in TrueNAS? Following this line of thinking for TrueNAS, I’m looking for a function to stop applications that I can integrate into the scheduling of snapshots. (cron job with docker stop command and zfs snapshot creation, API calls, or am I getting paranoid and doesn’t it matter that applications are running while creating snapshots?)

What is your advice?

I’m running TrueNAS 24.10.

I think for most apps, it doesn’t matter. There are some where it likely matters though, thinking in my case Mariadb, Nextcloud, Emby. For those apps, I do the backup from within the container using the recommended app approach. So, Emby has it’s own backup, which i use. Nextcloud has a documented way to backup, so I do that from a script within the container. And mariadb has a hot backup method which I use from within the container. Others than don’t have their own method, I do backup from outside.

I actually do not create daatsets for each application at all. I guess it depends what your goal is. I can restore from snapshots what I need without affecting other apps. And I have very few datasets which simplifies a lot of things for me.

Thanks for your response! Let me give that a try