Stretch Database architecture
When you enable Stretch Database for an on-premise SQL Server 2016 database, SQL Server automatically creates a new Stretch Database in MS Azure SQL Database as an external source and a remote endpoint for the database.
When you query the database, the SQL Server database engine runs the query against the local or remote database, depending on the data location. Queries against Stretch-enabled tables return both local and remote data by default. This is completely transparent to the database user. This means that you can use Stretch DB without changing Transact-SQL code in your queries, procedures, or applications. You can stretch an entire table or a portion of table data. The data migration is done asynchronously and transparently. In addition, Stretch Database ensures that no data is lost if a failure occurs during migration. It also has retry logic to handle connection issues that may occur during migration. Figure 6.1 illustrates the Stretch DB architecture...