How are Azure BACPAC backup files different than S

2019-06-22 07:46发布

问题:

Are BACPAC and BAK files conceptually the same thing? A single, self contained file in which you can use to backup/restore a database?

回答1:

BACPAC files are not transactionally consistent and that can lead to a database where data is not consistent across tables. Here's what I mean by this: if you start the process of creating a BACPAC and while that's going some data gets updated in the source database then the BACPAC file could contain data from table A as it was at 1:00 PM and also data from table X as it was at 1:03 PM ... but if table A was also updated at 1:03 PM that change may not exist in the BACPAC file if table A's data was exported at 1:00 PM by the export process.

It's important to create BACPAC exports from data sources where there is no write activity while the export executes.

In Azure SQL Database for example the best practice is to first create a copy of the database in question and then run the export to BACPAC on the copy (not on the original source db). Creating a copy of the database is transactionally consistent whereas the export to BACPAC is not.



回答2:

bacpac and Bak files are both snapshots of database as it existed at that point of time..

The only difference,i could think of for the bacpac file is,it validates schema bindings and fails if they are not correct,other than that both are same.One is in azure and one is in onpremises