SQL Server Always On – How Does Automatic Seeding Work in Always On Availability Group?

availability-groupsbackupenterprise-editionhigh-availabilitysql server

I found only these two statements from BOL regarding this Initial Data Synchronization method:

Link 1

Automatic seeding uses the log stream transport to stream the backup
using VDI to the secondary replica for each database of the
availability group using the configured endpoints.

Link 2

During automatic seeding, SQL Server performs a backup over the
network for initialization.

Looking into SQL Server Error logs of both primary and secondary replicas, these two logs caught my attention:

On primary replica

enter image description here

On secondary replica

enter image description here

My question is related to the working nature of automatic seeding, namely where does taken backup is stored before restoring on the secondary replica?

Best Answer

As you noted, the docs refer to "log stream transport" when performing automatic seeding. Similar to the way that you can stream movies to your device without downloading a specific file, automatic seeding streams data to the secondary without storing an actual backup file.

While the technical implementation details aren't exactly this, it's essentially taking a backup, but rather than sending it to a storage device or file share, it sends it to the secondary server. Rather than writing a file, it immediately begins to restore to the secondary server. The pseudo-backup is buffered and restored in a single step, without a literal backup being written to file.