Snapshots vs. Backups

Moderator: NorbertKrupa

Post Reply
billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Snapshots vs. Backups

Post by billykopecki » Wed May 15, 2013 1:21 pm

Hello,

Can someone explain the differences between a database snapshot (created using the DATABASE_SNAPSHOT function) and a database backup (created using the vbr.py utility).

Thanks!

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Snapshots vs. Backups

Post by scutter » Thu May 16, 2013 8:38 pm

The database backup uses a database snapshot to collect a consistent set of data files for the backup. For the duration of the backup process, that set of files will remain intact, so that even if a mergeout occurs on one of the ROS containers so that it no longer exists in the database, the file will still be present on disk so that it can be backed up. The backup collects other information as well that is needed in order to be able to restore the files, such as a dump of the database catalog.

--Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Re: Snapshots vs. Backups

Post by billykopecki » Fri May 17, 2013 4:01 am

Thanks for the reply, scutter!

I understand how the backup works via the vbr.py script (I think). I guess what I don't understand is why we have the function DATABASE_SNAPSHOT. I've ran the command and see the data files created on disk that make up the snapshot. But what's the point? We can not restore a snapshot can we?

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Snapshots vs. Backups

Post by scutter » Fri May 17, 2013 2:23 pm

No, you can't restore a snapshot using any scripts provided. It would be technically possible if Vertica provided such a script, but it's not there today. Using a snapshot to create a local backup just before doing an upgrade for example.

The snapshot is just a mechanism for preserving the complete set of files that are needed for the full backup, ensuring that they remain present for the duration of the backup so that they can all be backed up. If you didn't have a database snapshot created, then you couldn't be guaranteed of getting a consistent set of files. The snapshot doesn't use up much space - only the space of any ROS containers that are removed (explicitly or by the tuple mover) for the duration of the backup.

--Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

billykopecki
Beginner
Beginner
Posts: 42
Joined: Thu Apr 19, 2012 9:03 pm

Re: Snapshots vs. Backups

Post by billykopecki » Sat May 18, 2013 1:20 am

Hi,

Sorry, but I still don't get it. Why would I ever need to run a SELECT DATABASE_SNAPSHOT()? It makes no sense to me. I can create a snapshot that I can never restore? Big whoop.

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Snapshots vs. Backups

Post by scutter » Sun May 19, 2013 2:53 pm

You won't ever need to execute "select database_snapshot()". It's there for the backup utility, no other reason unless you were to write a custom backup script. If it bothers you that it exists, then pretend that it doesn't exist :-)

--Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

Post Reply

Return to “Vertica Backup & Recovery”