Skip to content
RED SAGSkills
easyDatabase Administrator interview question

When would you use a logical backup like pg_dump or mysqldump, and when a physical backup?

What the interviewer wants to hear

  • Logical backups export SQL-level data and are portable across versions and platforms
  • Logical backups are good for small databases, single tables and migrations
  • Physical backups copy data files and are much faster to restore for large databases
  • Physical backups plus WAL or binlog archiving allow point-in-time recovery
  • Many teams use both, and test restores of each

Model answer

A logical backup, such as pg_dump or mysqldump, exports tables as SQL or a portable archive. It is great for small databases, for copying one table or schema, and for moving data between major versions or platforms. Its weakness is restore time, because every row is reloaded and every index rebuilt, and it only captures one moment. A physical backup, made with pgBackRest, pg_basebackup or Percona XtraBackup, copies the data files themselves. It restores much faster for large databases and, combined with archived WAL or binlogs, lets me recover to any point in time, for example one minute before a bad DELETE. For production I rely on physical backups with archiving as the main recovery path, keep logical dumps of important schemas as an extra, and test restores of both regularly.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Database Administrator questions