Logical vs Physical Database Backup
Compare exporting database contents with copying database files.
| Dimension | Logical backup | Physical backup | What it means in practice |
|---|---|---|---|
| What is copied | SQL statements or an archive of rows and schema. | Data files and logs at block level. | Physical backups include indexes as built; logical restores rebuild them. |
| Restore speed | Slow for large databases. | Fast; close to file copy speed. | Measure restore time against the recovery objective. |
| Portability | Works across versions and platforms. | Same major version and platform. | Use logical dumps for upgrades and migrations. |
| Point-in-time recovery | Not by itself. | Yes, combined with WAL, binlog or log backups. | PITR needs a physical base backup in most engines. |
| Granularity | Single tables or schemas easily. | Whole cluster or instance. | Restore a single table from a physical backup by restoring elsewhere and exporting it. |
| Tools | pg_dump, mysqldump, bcp/BACPAC. | pg_basebackup, Mariabackup, BACKUP DATABASE, storage snapshots. | Test both kinds with real restores. |