Search code examples
kubernetesneo4jbackupdatabase-backups

Is it a good idea to backup/restore Neo4j databases with Kubernetes VolumeSnapshot?


I have a Neo4j database running on Kubernetes. I want to make scheduled backups for the database. I know that Neo4j provides a set of tools for backup and restore. However, Kubernetes VolumeSnapshot also looks viable for backup and restore.

I wonder if it's a good idea to use Kubernetes VolumeSnapshot to backup/restore Neo4j databases? Will it cause errors like inconsistency database status or faulty disk problem? Thanks.


Solution

  • Generally, if it is not supported by the database, then it is a bad idea.

    Think of your database as being stored across:

    1. Database files on disk
    2. Page cache (in volatile memory)
    3. Write ahead transaction logs on disk

    A volume snapshot would not save enough information to get a consistent state of your database (unless the database is gracefully shut down).

    Use the set of tools provided for backup/restore