Database dump
A database dump is a file holding the contents of a database at a point in time: the table structure and the data. Most often it is a logical dump, that is, a sequence of SQL statements (CREATE TABLE, INSERT) whose execution recreates the database; such files are produced by the pg_dump (PostgreSQL) and mysqldump (MySQL) utilities. Less often a physical copy of the storage files is made. Sometimes the word “dump” is also used for just a set of data exported from a database, and then a dump is confused with a backup. A backup is a spare copy made to recover after a failure; a dump can serve as a backup, but it is also made for other purposes: moving data between servers and deploying a copy of the database on a test stand. Before a dump is loaded into pre-prod or a test environment, personal data is removed or masked so that it does not become available to persons with no access to the production environment.
Frequently asked questions
What is a database dump?
A file holding the contents of a database at a point in time (table structure and data), most often as SQL statements from which the database can be restored.Why is a dump needed for staging?
Loading a dump fills the pre-prod database with data close to production data and makes it possible to check a release and schema migrations under near-production conditions.How to remove personal data from a dump?
Masking is applied: names, email addresses, phone numbers and other personal data are replaced with made-up values while the format and the relations between tables are kept, so the data stays usable for tests and reveals no real people.Are a dump and a backup the same thing?
No, although they are often confused. A backup is a spare copy made to recover after a failure, and there are several ways to make one, including a physical copy of the files. A dump is a file of SQL statements or a set of data: it is made both as a backup and for moving data or for a test stand.How is a dump different from a mocked database?
A dump holds the real data of a database as a file. A mock is an imitation of the database that replies with predefined answers.Source: Wikipedia: Database dump