A snapshot taken by a cloud provider or a storage array knows nothing about writes that are still in memory. Freezing the filesystem for a moment fixes that.
sudo fsfreeze -f /srv/data
# take the snapshot now
sudo fsfreeze -u /srv/data
With -f, running transactions finish, new writes are halted and everything pending is flushed to disk. -u releases it. The man page lists ext4, XFS and btrfs among the supported types.
Put both in one script so the thaw is not forgotten, even when the snapshot command fails:
sudo fsfreeze -f /srv/data
trap 'sudo fsfreeze -u /srv/data' EXIT
./make-snapshot.sh
Warning: every process that tries to write to a frozen filesystem blocks until you unfreeze it. Never freeze / or the volume that holds your shell history, logs or the snapshot tool itself, or you may lock yourself out with a reboot as the only way back.
I would try it once on a spare mount first. And it only makes the filesystem consistent. A database may still need its own flush or backup command to give you data that is in a good state. LVM snapshots already freeze the filesystem for you, so there is no need to add this there.
Further reading: fsfreeze man page