This document provides an overview of migrating databases from on-premises SQL Server to Azure SQL Database Managed Instance. It discusses why companies are moving to the cloud, challenges with migration, and the tools and services available to help with assessment and migration including Data Migration Service. Key steps in the migration workflow include assessing the database and application, addressing compatibility issues, and deploying the converted schema to Managed Instance which provides high compatibility with on-premises SQL Server in a fully managed platform as a service model.
Azure SQL Database Managed Instance: A Solution for Easy Migration to PaaS SQL
1.
2. 2
About Me Cloud Solution Architect (Data & AI), Microsoft
Previously, Senior Program Manager (SQL Tiger Team)
10 Years
@talktosavjani
http://www.sqlserverfaq.net
https://blogs.msdn.microsoft.com/sql_server_team/
https://blogs.msdn.microsoft.com/sqlreleaseservices/
https://www.slideshare.net/talktosavjani
5. 5
The overall database market in 2016 was valued at $33B
with RDBMS accounting for 95%.
RDBMS Market Size
Total RDBMS Revenue: $31.2B
2016 RDBMS Market Size By Revenue
By Region, On-Premises, Cloud Native, & Cloud VM, Billions of USD
On-Premise:
93%
Cloud:
7%
$0.7 $0.2
Americas
$15.3 $4.8$9.0
$0.4
$0.5 $0.3 $0.1
$16.5 $5.1$9.6
On-Premises
Cloud: VM
Cloud: Native
EMEA APAC
6. What does the future hold?
2017 Cloud Migration Survey Report - Cloudendure
Preliminary IDC Hosted Dedicated Private Cloud Services Forecast (4Q2014)
7. Dev can focus on the app
Database as a Service Evolution
Intelligent DBaaS capabilitiesAzure SQL Database Service
DBaaS v2.0 - Intelligent Database Service
- Platform manages all aspects of running and tuning the DB
8. Authentication
Azure Active
Directory
Scheduled
Integration with Azure Ecosystem
Manage
performance
Monitoring and
alerting
Load-balance
databases
Handle fluctuating
aggregate workload
Handle intense isolated
tenant workload
Catalog tenants
and databases
Manage extended
tenant meta dataConnect app to
tenant database
Provision database
and schema
Pre-provision databases to reduce
tenant onboarding latency
Manage
schema change
Scheduled
Reactive
Recover tenant data
after tenant error
BCDR
Restore from geo-
redundant backup
Geo-replicate dbs for
fastest recovery
Tenant self
service
Cross-Tenant
Analytics
Managed recovery of
tenants at scale
Tenant self service
Query across tenant
databases
Extract and analyze
tenant data
SQL DW
SQL DB + ColumnStore
Elastic Jobs
Manage schema
versioning via catalog
Monitor app and
data layer
Reactive
Pro-active
Elastic Pools
Elastic database client library,
Shard Management schema
ARM template,
bacpac
Geo-restore
GeoDR, AutoDR
Auto-provision
databases
PITR
Portal + OMS
Azure Automation +
ARM templates
Geo-distributed
tenant dbs
PowerBI
Elastic
Jobs
Elastic Query
Browse
tenants
Azure SQL
Database
Active/active cross-
replication
Pro-active
Azure Automation
Search
Azure Search
14. 14
Common Challenges
SQL PaaS Unsupported Data Types : NTEXT and TEXT columns
needed to be converted to nvarchar(max)
SQL Agent Jobs : Need to be converted to elastic Jobs or hosted
in IaaS SQL.
External Tables : Cross database joins are not supported. Create
external tables and remove the 3 part references(e.g.
[dbo].[database].[table]) to make the schema compatible.
UTC Dates : Custom date function using AT TIME ZONE in all table
defaults, Stored Procedures, functions etc.. to report time in
regional format.
15. NTEXT -> varchar
-- Change TEXT to VARCHAR(MAX)
ALTER TABLE billing_schedule ALTER COLUMN description varchar(max)
NULL
ALTER TABLE billing_schedule ALTER COLUMN notes varchar(max) NULL
ALTER TABLE contract ALTER COLUMN notes varchar(max) NULL
ALTER TABLE contract ALTER COLUMN warnings varchar(max) NULL
16. Cross database transactions
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'strongpassword';
GO
CREATE DATABASE SCOPED CREDENTIAL [ebhDataServiceCred] WITH IDENTITY = 'username',
SECRET = 'strongpassword';
GO
CREATE EXTERNAL DATA SOURCE [ebhDataService] WITH
(TYPE = RDBMS,
LOCATION = 'yourserver.database.windows.net',
DATABASE_NAME = 'YourExternalDatabase',
CREDENTIAL = ebhDataServiceCred,
)
GO
EXEC sp_execute_remote @data_source_name = N'ebhDataService', @stmt = @cmd;
GO
17. Custom date function
CREATE FUNCTION getlocaldate()
returns DATETIME
as
begin
DECLARE @D AS datetimeoffset
SET @D = CONVERT(datetimeoffset, getdate()) AT TIME ZONE 'Eastern
Standard Time';
SELECT CONVERT(datetime, @D);
end
21. What is SQL Database Managed Instance?
Unmatched app
compatibility
• Fully-fledged SQL
instance with nearly
100% compat with
on-prem
Unmatched PaaS
capabilities
• Lowest TCO + rich
Azure ecosystem
• Built-in auto
management
Favorable business
model
• Competitive
• Transparent
• Frictionless
A flavor of SQL DB designed to provide
easy migration to fully managed PaaS
SQL Database
(PaaS)
Elastic
Pool
Managed
Instance
Singleton
22. Full security & isolation
Supports Azure AD authentication (can be
federated with on-premise AD)
SQL Instance #1 SQL Instance #2
IPsec IKE S2S VPN Tunnel оn-premisesVPN / Express Route
Gateway
SQL Instance #3
VNet1
VNet-to-VNet
Network isolation
(customer VNET)
Tenant isolation
(compute, storage)
“Virtual data cluster” dedicated to customer
(virtual private cluster, VNET, private IPs)
Web app
(public IP)
24. Lift and Shift of on-premises
workload to
Managed Instance
25. Choosing the right data platform for your workload
One database per app pattern Lift-and-shift rich SQL apps
to PaaS
Cloud born applications Application developed on box
SQL Server
DB-centric programming
model
Tenant isolation / resource
guaranteed at the DB level
• Rich, instance-centric
programming model
• Resource guaranteed/SLA at
Instance-level
Cloud born applications
New multi-tenant SaaS apps
or modernized existing apps
to SaaS
Higher utilization efficiency
with a shared resource model
Resource guaranteed/SLA at
the pool level
Elastic Pool Managed InstanceSingleton