Sunday, 15 January 2023

Features comparison: Azure SQL Database and Azure SQL Managed Instance in azure

 Azure SQL Database and SQL Managed Instance share a common code base with the latest stable version of SQL Server. Most of the standard SQL language, query processing, and database management features are identical. The features that are common between SQL Server and SQL Database or SQL Managed Instance are:

Azure manages your databases and guarantees their high-availability. Some features that might affect high-availability or can't be used in PaaS world have limited functionalities in SQL Database and SQL Managed Instance. These features are described in the tables below.

If you need more details about the differences, you can find them in the separate pages:

Features of SQL Database and SQL Managed Instance

The following table lists the major features of SQL Server and provides information about whether the feature is partially or fully supported in Azure SQL Database and Azure SQL Managed Instance, with a link to more information about the feature.

FeatureAzure SQL DatabaseAzure SQL Managed Instance
Always EncryptedYes - see Cert store and Key vaultYes - see Cert store and Key vault
Always On Availability Groups99.99-99.995% availability is guaranteed for every database. Disaster recovery is discussed in Overview of business continuity with Azure SQL Database99.99.% availability is guaranteed for every database and can't be managed by user. Disaster recovery is discussed in Overview of business continuity with Azure SQL Database. Use Auto-failover groups to configure a secondary SQL Managed Instance in another region. SQL Server instances and SQL Database can't be used as secondaries for SQL Managed Instance.
Attach a databaseNoNo
AuditingYesYes, with some differences
Azure Active Directory (Azure AD) authenticationYes. Azure AD users only.Yes. Including server-level Azure AD logins.
BACKUP commandNo, only system-initiated automatic backups - see Automated backupsYes, user initiated copy-only backups to Azure Blob storage (automatic system backups can't be initiated by user) - see Backup differences
Built-in functionsMost - see individual functionsYes - see Stored procedures, functions, triggers differences
BULK INSERT statementYes, but just from Azure Blob storage as a source.Yes, but just from Azure Blob Storage as a source - see differences.
Certificates and asymmetric keysYes, without access to file system for BACKUP and CREATE operations.Yes, without access to file system for BACKUP and CREATE operations - see certificate differences.
Change data capture - CDCYes, for S3 tier and above. Basic, S0, S1, S2 are not supported.Yes
Collation - server/instanceNo, default server collation SQL_Latin1_General_CP1_CI_AS is always used.Yes, can be set when the instance is created and can't be updated later.
Columnstore indexesYes - Premium tier, Standard tier - S3 and above, General Purpose tier, Business Critical, and Hyperscale tiers.Yes
Common language runtime - CLRNoYes, but without access to file system in CREATE ASSEMBLY statement - see CLR differences
CredentialsYes, but only database scoped credentials.Yes, but only Azure Key Vault and SHARED ACCESS SIGNATURE are supported - see details
Cross-database/three-part name queriesNo - see Elastic queriesYes
Cross-database transactionsNoYes, within the instance. See Linked server differences for cross-instance queries.
Database mail - DbMailNoYes
Database mirroringNoNo
Database snapshotsNoNo
DBCC statementsMost - see individual statementsYes - see DBCC differences
DDL statementsMost - see individual statementsYes - see T-SQL differences
DDL triggersDatabase onlyYes
Distributed partition viewsNoYes
Distributed transactions - MS DTCNo - see Elastic transactionsNo - see Elastic transactions
DML triggersMost - see individual statementsYes
DMVsMost - see individual DMVsYes - see T-SQL differences
Elastic queryYes, with required RDBMS type (public preview)No, use native cross-DB queries and Linked Server instead
Event notificationsNo - see AlertsNo
ExpressionsYesYes
Extended events (XEvent)Some - see Extended events in SQL DatabaseYes - see Extended events differences
Extended stored proceduresNoNo
Files and file groupsPrimary file group onlyYes. File paths are automatically assigned and the file location can't be specified in ALTER DATABASE ADD FILE statement.
FilestreamNoNo
Full-text search (FTS)Yes, but third-party filters and word breakers are not supportedYes, but third-party filters and word breakers are not supported
FunctionsMost - see individual functionsYes - see Stored procedures, functions, triggers differences
In-memory optimizationYes in Premium and Business Critical service tiers.
Limited support for non-persistent In-Memory OLTP objects such as memory-optimized table variables in Hyperscale service tier.
Yes in Business Critical service tier
Language elementsMost - see individual elementsYes - see T-SQL differences
LedgerYesNo
Link featureNoYes (public preview)
Linked serversNo - see Elastic queryYes. Only to SQL Server and SQL Database without distributed transactions.
Linked servers that read from files (CSV, Excel)No. Use BULK INSERT or OPENROWSET as an alternative for CSV format.No. Use BULK INSERT or OPENROWSET as an alternative for CSV format. Track these requests on SQL Managed Instance feedback item
Log shippingHigh availability is included with every database. Disaster recovery is discussed in Overview of business continuity.Natively built in as a part of Azure Data Migration Service (DMS) migration process. Natively built for custom data migration projects as an external Log Replay Service (LRS).
Not available as High availability solution, because other High availability methods are included with every database and it is not recommended to use Log-shipping as HA alternative. Disaster recovery is discussed in Overview of business continuity. Not available as a replication mechanism between databases - use secondary replicas on Business Critical tierauto-failover groups, or transactional replication as the alternatives.
Logins and usersYes, but CREATE and ALTER login statements do not offer all the options (no Windows and server-level Azure Active Directory logins). EXECUTE AS LOGIN is not supported - use EXECUTE AS USER instead.Yes, with some differences. Windows logins are not supported and they should be replaced with Azure Active Directory logins.
Minimal logging in bulk importNo, only Full Recovery model is supported.No, only Full Recovery model is supported.
Modifying system dataNoYes
OLE AutomationNoNo
OPENDATASOURCENoYes, only to SQL Database, SQL Managed Instance and SQL Server. See T-SQL differences
OPENQUERYNoYes, only to SQL Database, SQL Managed Instance and SQL Server. See T-SQL differences
OPENROWSETYes, only to import from Azure Blob storage.Yes, only to SQL Database, SQL Managed Instance and SQL Server, and to import from Azure Blob storage. See T-SQL differences
OperatorsMost - see individual operatorsYes - see T-SQL differences
PolybaseNo. You can query data in the files placed on Azure Blob Storage using OPENROWSET function or use an external table that references a serverless SQL pool in Synapse Analytics.Yes, for Azure Data Lake Storage (ADLS) and Azure Blob Storage as data source. See Data Virtualization with Azure SQL Managed Instance for more details.
Query NotificationsNoYes
Machine Learning Services (Formerly R Services)NoYes - see Machine Learning Services in Azure SQL Managed Instance
Recovery modelsOnly Full Recovery that guarantees high availability is supported. Simple and Bulk Logged recovery models are not available.Only Full Recovery that guarantees high availability is supported. Simple and Bulk Logged recovery models are not available.
Resource governorNoYes
RESTORE statementsNoYes, with mandatory FROM URL options for the backups files placed on Azure Blob Storage. See Restore differences
Restore database from backupFrom automated backups only - see SQL Database recoveryFrom automated backups - see SQL Database recovery and from full backups placed on Azure Blob Storage - see Backup differences
Restore database to SQL ServerNo. Use BACPAC or BCP instead of native restore.No, because SQL Server database engine used in SQL Managed Instance has higher version than any RTM version of SQL Server used on-premises. Use BACPAC, BCP, or Transactional replication instead.
Semantic searchNoNo
Service BrokerNoYes, but only within the instance. If you are using remote Service Broker routes, try to consolidate databases from several distributed SQL Server instances into one SQL Managed Instance during migration and use only local routes. See Service Broker differences
Server configuration settingsNoYes - see T-SQL differences
Set statementsMost - see individual statementsYes - see T-SQL differences
SQL Server AgentNo - see Elastic jobs (public preview)Yes - see SQL Server Agent differences
SQL Server AuditingNo - see SQL Database auditingYes - see Auditing differences
System stored functionsMost - see individual functionsYes - see Stored procedures, functions, triggers differences
System stored proceduresSome - see individual stored proceduresYes - see Stored procedures, functions, triggers differences
System tablesSome - see individual tablesYes - see T-SQL differences
System catalog viewsSome - see individual viewsYes - see T-SQL differences
TempDBYes. 32-GB size per core for every database.Yes. 24-GB size per vCore for entire GP tier and limited by instance size on BC tier
Temporary tablesLocal and database-scoped global temporary tablesLocal and instance-scoped global temporary tables
Time zone choiceNoYes, and it must be configured when the SQL Managed Instance is created.
Trace flagsNoYes, but only limited set of global trace flags. See DBCC differences
Transactional ReplicationYes, Transactional and snapshot replication subscriber onlyYes (public preview) - see limitations.
Transparent data encryption (TDE)Yes - General Purpose, Business Critical, and Hyperscale service tiers only.Yes
Windows authenticationNoYes - see Windows Authentication for Azure Active Directory principals
Windows Server Failover ClusteringNo. Other techniques that provide high availability are included with every database. Disaster recovery is discussed in Overview of business continuity with Azure SQL Database.No. Other techniques that provide high availability are included with every database. Disaster recovery is discussed in Overview of business continuity with Azure SQL Database.

Platform capabilities

The Azure platform provides a number of PaaS capabilities that are added as an additional value to the standard database features. There is a number of external services that can be used with Azure SQL Database.

Platform featureAzure SQL DatabaseAzure SQL Managed Instance
Active geo-replicationYes - all service tiers.No - see Auto-failover groups as an alternative.
Auto-failover groupsYes - all service tiers.Yes - see Auto-failover groups.
Auto-scaleYes, but only in serverless model. In the non-serverless model, the change of service tier (change of vCore, storage, or DTU) is fast and online. The service tier change requires minimal or no downtime.No, you need to choose reserved compute and storage. The change of service tier (vCore or max storage) is online and requires minimal or no downtime.
Automatic backupsYes. Full backups are taken every 7 days, differential 12 hours, and log backups every 5-10 min.Yes. Full backups are taken every 7 days, differential 12 hours, and log backups every 5-10 min.
Automatic tuning (indexes)YesNo
Availability ZonesYesIn preview for the Business Critical tier only
Azure Resource HealthYesNo
Short-term backup retentionYes. 7 days default, max 35 days.Yes. 7 days default, max 35 days.
Data Migration Service (DMS)YesYes
Elastic jobsYes - see Elastic jobs (public preview)No. SQL Agent can be used instead.
File system accessNo. Use BULK INSERT or OPENROWSET to access and load data from Azure Blob Storage as an alternative.No. Use BULK INSERT or OPENROWSET to access and load data from Azure Blob Storage as an alternative.
Geo-restoreYesYes
Hyperscale architectureYesNo
Long-term backup retention - LTRYes, keep automatically taken backups up to 10 years. Long-term retention policies are not yet supported for Hyperscale databases.Yes, keep automatically taken backups up to 10 years.
Pause/resumeYes, in serverless modelNo
Policy-based managementNoNo
Public IP addressYes. The access can be restricted using firewall or service endpoints.Yes. Needs to be explicitly enabled and port 3342 must be enabled in NSG rules. Public IP can be disabled if needed. See Public endpoint for more details.
Point in time database restoreYes - all service tiers. See SQL Database recoveryYes - see SQL Database recovery
Resource poolsYes, as Elastic poolsYes. A single instance of SQL Managed Instance can have multiple databases that share the same pool of resources. In addition, you can deploy multiple instances of SQL Managed Instance in instance pools (public preview) that can share the resources.
Scaling up or down (online)Yes, you can either change DTU or reserved vCores or max storage with the minimal downtime.Yes, you can change reserved vCores or max storage with the minimal downtime.
SQL AliasNo, use DNS AliasNo, use Cliconfg to set up alias on the client machines.
SQL AnalyticsYesYes
SQL Data SyncYesNo
SQL Server Analysis Services (SSAS)No, Azure Analysis Services is a separate Azure cloud service.No, Azure Analysis Services is a separate Azure cloud service.
SQL Server Integration Services (SSIS)Yes, with a managed SSIS in Azure Data Factory (ADF) environment, where packages are stored in SSISDB hosted by Azure SQL Database and executed on Azure SSIS Integration Runtime (IR), see Create Azure-SSIS IR in ADF.

To compare the SSIS features in SQL Database and SQL Managed Instance, see Compare SQL Database to SQL Managed Instance.
Yes, with a managed SSIS in Azure Data Factory (ADF) environment, where packages are stored in SSISDB hosted by SQL Managed Instance and executed on Azure SSIS Integration Runtime (IR), see Create Azure-SSIS IR in ADF.

To compare the SSIS features in SQL Database and SQL Managed Instance, see Compare SQL Database to SQL Managed Instance.
SQL Server Reporting Services (SSRS)No - see Power BINo - use Power BI paginated reports instead or host SSRS on an Azure VM. While SQL Managed Instance cannot run SSRS as a service, it can host SSRS catalog databases for a reporting server installed on Azure Virtual Machine, using SQL Server authentication.
Query Performance Insights (QPI)YesNo. Use built-in reports in SQL Server Management Studio and Azure Data Studio.
VNetPartial, it enables restricted access using VNet EndpointsYes, SQL Managed Instance is injected in customer's VNet. See subnet and VNet
VNet Service endpointYesYes
VNet Global peeringYes, using Private IP and service endpointsYes, using Virtual network peering.
Private connectivityYes, using Private LinkYes, using VNet.

Tools

Azure SQL Database and Azure SQL Managed Instance support various data tools that can help you manage your data.

ToolAzure SQL DatabaseAzure SQL Managed Instance
Azure portalYesYes
Azure CLIYesYes
Azure Data StudioYesYes
Azure PowerShellYesYes
BACPAC file (export)Yes - see SQL Database exportYes - see SQL Managed Instance export
BACPAC file (import)Yes - see SQL Database importYes - see SQL Managed Instance import
Data Quality Services (DQS)NoNo
Master Data Services (MDS)NoNo. Host MDS on an Azure VM. While SQL Managed Instance cannot run MDS as a service, it can host MDS databases for an MDS service installed on Azure Virtual Machine, using SQL Server authentication.
SMOYesYes version 150
SQL Server Data Tools (SSDT)YesYes
SQL Server Management Studio (SSMS)YesYes version 18.0 and higher
SQL Server PowerShellYesYes
SQL Server ProfilerNo - see Extended eventsYes
System Center Operations ManagerYesYes

Migration methods

You can use different migration methods to move your data between SQL Server, Azure SQL Database and Azure SQL Managed Instance. Some methods are Online and picking-up all changes that are made on the source while you are running migration, while in Offline methods you need to stop your workload that is modifying data on the source while the migration is in progress.

SourceAzure SQL DatabaseAzure SQL Managed Instance
SQL Server (on-premises, AzureVM, Amazon RDS)Online: Transactional Replication
Offline: Data Migration Service (DMS)BACPAC file (import), BCP
Online: Data Migration Service (DMS)Transactional Replication
Offline: Native backup/restore, BACPAC file (import), BCP, Snapshot replication
Single databaseOffline: BACPAC file (import), BCPOffline: BACPAC file (import), BCP
SQL Managed InstanceOnline: Transactional Replication
Offline: BACPAC file (import), BCP, Snapshot replication
Online: Transactional Replication
Offline: Cross-instance point-in-time restore (Azure PowerShell or Azure CLI), Native backup/restoreBACPAC file (import), BCP, Snapshot replication

No comments:

Post a Comment