Presentation is loading. Please wait.

Presentation is loading. Please wait.

Migrating to Azure SQL Database: Tips, Tricks, and Lessons Learned

Similar presentations


Presentation on theme: "Migrating to Azure SQL Database: Tips, Tricks, and Lessons Learned"— Presentation transcript:

1 Migrating to Azure SQL Database: Tips, Tricks, and Lessons Learned
Randolph West DATA PLATFORM MVP @bornsql bornsql.ca/blog

2 PREPARE FOR OBSOLESCENCE
Migrating to Azure Sql Database PREPARE FOR OBSOLESCENCE Everything I was going to tell you today was obsolete on Wednesday. This is how quickly things change. Azure SQL Database is always getting better: three ways to migrate speed was doubled across the board earlier this year databases larger than 1TB are supported all the things missing, are coming soon.

3 What is Azure SQL Database?
This is a marketing slide What is Azure SQL Database? Azure SQL Database is a cloud-based relational database service, built on the Microsoft SQL Server engine, designed to deliver predictable performance and scalability, with virtually no downtime, and near- zero administration. Azure SQL delivers predictable performance, scalability with no downtime, business continuity and data protection—all with near-zero administration. Developers can focus on rapid app development and getting their apps and solutions into production instead of managing VMs and infrastructures. Since Azure SQL is based on the Microsoft SQL Server engine, it supports existing SQL Server tools, libraries and APIs, which makes it easy for developers and organizations to extend to the cloud. Source: Microsoft

4 Common Business Differentiators (TODAY)
This is another marketing slide, which is now obsolete Common Business Differentiators (TODAY) Azure SQL Database SQL Server You’re building new cloud-based applications to take advantage of cost savings and performance. You want to build enterprise applications larger than 1 TB
(4 TB). You want databases replicated in different regions of the world for backup. You have existing IT resources and can maintain stewardship over backups and database high availability. You want Microsoft to handle common management operations. Although there is a number of differences between Azure SQL and SQL Server, the primary differences have more to do with scale and resources than actual features. For developers there are minor differences in development, mostly around T-SQL variations, Most of the Transact-SQL features that applications depend on are supported in both Microsoft SQL Server and Azure SQL. Some unsupported features are data types, operators, as well as string, arithmetic, logical, and cursor functions. Another important difference is that Azure SQL is designed to isolate features from any dependency on the master database, and so some server-level activities are unsupported. NOTE: Features that are deprecated in SQL Server are generally not supported in Azure SQL.

5 Why are you migrating? Do you have to choose? Why? Are you sure?
migrating to Azure SQL Database Why are you migrating? Do you have to choose? Why? Are you sure? Is your company going to benefit from this?

6 Platform as a service (Paas)
migrating to azure sql database Platform as a service (Paas) Mostly compatible with SQL Server 2014, 2016 and 2017 Pay-as-you-go Scale-up or scale-out instantly* Automatically configured, patched, and upgraded Automated backups, Point-In-Time Restore, Geo-Restore, and Active Geo- Replication Pay per hour, per service tier and performance level Pay for data transfer Total cost of application = Highly minimized administration costs + software development costs + SQL Database service costs

7 Infrastructure as a service (iaas)
Migrating to azure sql database Infrastructure as a service (iaas) SQL Server 2014, 2016, or 2017, installed on a virtual machine Per-minute licensing cost (Web, Standard, Enterprise) Or bring your own existing licence and only pay for Windows VM Fully customisable You are responsible for managing it (patching, maintenance, backups) Pay for premium storage (SSD drives: P10, P20, P30) Total cost of application = Minimized software development/modification costs + administration costs + SQL Server and Windows Server licensing costs + Azure Storage costs

8 Azure SQL Database Limitations (TODAY)
Migrating to azure sql database Azure SQL Database Limitations (TODAY) features/ Highlights: No Windows Authentication (Azure AD is supported) TCP/IP on port 1433 only No SQL Server Agent jobs (on-premises only) Fixed Collation (default SQL_Latin1_General_CP1_CI_AS) Restricted usernames (admin, administrator, guest, root, sa, ‘\’)

9 Transact-SQL Differences in Azure SQL Database (TODAY)
Migrating to azure sql database Transact-SQL Differences in Azure SQL Database (TODAY) database-transact-sql-information/ “Azure SQL Database is designed to isolate features from any dependency on the master database. As a consequence many server-level activities are inappropriate for SQL Database and are unsupported.” – Microsoft

10 Features Not Supported (TODAY)
This is a slide you can’t read Features Not Supported (TODAY) Collation of system objects High availability: Syntax related to high availability, which is managed through your Microsoft Azure account. This includes syntax for backup, restore, Always On, database mirroring, log shipping, recovery modes. Server credentials: Use database scoped credentials instead. Trace flags: Some trace flag items have been moved to compatibility modes. Connection related: Endpoint statements, ORIGINAL_DB_NAME. SQL Database does not support Windows authentication, but does support the similar Azure Active Directory authentication. Some authentication types require the latest version of SSMS. For more information, see Connecting to SQL Database or SQL Data Warehouse By Using Azure Active Directory Authentication. Server-level items: Server roles, IS_SRVROLEMEMBER, sys.login_token. GRANT, REVOKE, and DENY of server level permissions are not available though some are replaced by database-level permissions. Some useful server-level DMVs have equivalent database-level DMVs. Transact-SQL debugging Triggers: Server-scoped or logon triggers USE statement: To change the database context to a different database, you must make a new connection to the new database. Log reader: Syntax that relies upon the log reader, which is not available on SQL Database: Push Replication, Change Data Capture. SQL Database can be a subscriber of a push replication article. SET REMOTE_PROC_TRANSACTI ONS Cross database queries using three or four part names. (Read- only cross-database queries are supported by using elastic database query.) Functions: fn_get_sql, fn_virtualfilestats, fn_virtualservernodes SHUTDOWN Global temporary tables sp_addmessage Cross database ownership chaining, TRUSTWORTHY setting Hardware: Syntax related to hardware-related server settings: such as memory, worker threads, CPU affinity, trace flags. Use service levels instead. sp_configure options and RECONFIGURE. Some options are available using ALTER DATABASE SCOPED CONFIGURATION. DATABASEPROPERTY Use DATABASEPROPERTYEX instead. sp_helpuser HAS_DBACCESS sp_migrate_user_to_contained EXECUTE AS LOGIN Use 'EXECUTE AS USER' instead. KILL STATS JOB SQL Server Agent: Syntax that relies upon the SQL Server Agent or the MSDB database: alerts, operators, central management servers. Use scripting, such as Azure PowerShell instead. Encryption is supported except for extensible key management OPENQUERY, OPENROWSET, OPENDATASOURCE, and four- part names Eventing: Events, event notifications, query notifications .NET Framework: CLR integration with SQL Server File placement: Syntax related to database file placement, size, and database files that are automatically managed by Microsoft Azure. SQL Server audit: Use SQL Database auditing instead. Semantic search SQL Server trace

11 Migrating a SQL Server Database to Azure SQL Database
Migrating to Azure SQL Database Migrating a SQL Server Database to Azure SQL Database cloud-migrate Check compatibility with Data Migration Assistant (DMA) Choose a Service Level and Performance Tier Three primary methods to migrate to Azure SQL Database: Migrate with downtime during migration (demo 😀) Transactional Replication (no demo 😟) Live migration through Azure Portal (coming soon)

12 Transactional replication method
No demo, so here’s a picture Transactional replication method Configure your Azure SQL Database as a subscriber to the SQL Server instance that you wish to migrate. The transactional replication distributor synchronizes data from the database to be synchronized (the publisher) while new transactions continue occur. Source: Microsoft

13 LIVE MIGRATION THROUGH THE AZURE PORTAL
No demo, so here’s a picture LIVE MIGRATION THROUGH THE AZURE PORTAL Source: Microsoft

14 LIVE MIGRATION THROUGH THE AZURE PORTAL
No demo, so here’s a picture LIVE MIGRATION THROUGH THE AZURE PORTAL Source: Microsoft

15 LIVE MIGRATION THROUGH THE AZURE PORTAL
No demo, so here’s a picture LIVE MIGRATION THROUGH THE AZURE PORTAL Source: Microsoft

16 LIVE MIGRATION THROUGH THE AZURE PORTAL
No demo, so here’s a picture LIVE MIGRATION THROUGH THE AZURE PORTAL Source: Microsoft

17 LIVE MIGRATION THROUGH THE AZURE PORTAL
No demo, so here’s a picture LIVE MIGRATION THROUGH THE AZURE PORTAL Source: Microsoft

18 sERVICE LEVEL AND PERFORMANCE TIER (CAD)
want to spend some money? Here’s how sERVICE LEVEL AND PERFORMANCE TIER (CAD) Level Tier DTUs Size Cost p.m. Basic 5 2 GB $6.06 Standard S0 10 250 GB $18.28 S1 20 $36.46 S2 50 $91.19 S3 100 $182.38 Premium P1 125 500 GB $565.40 P2 250 $1,130.79 P4 500 $2,261.58 P6 1000 $4,523.15 P11 1750 4 TB $8,512.57 P15 4000 $19,458.59

19 What the heck is a dtu? Database Transaction Unit (DTU):
THIS SLIDE POSES A PUZZLING QUESTION What the heck is a dtu? Database Transaction Unit (DTU): Combination of I/O, RAM, CPU and log writes in some magical* formula Azure SQL Database benchmark overview: benchmark-overview/ DTU Calculator (3rd party product): % Processor Time, Disk Reads/sec, Disk Writes/sec, Log Bytes Flushed/sec The DTU Calculator makes a recommendation of the minimum performance level and service tier that you need before you migrate to Azure SQL Database.

20 CAN I SHARE RESOURCES BETWEEN AZURE SQL DATABASES?
ADD-ON QUESTION CAN I SHARE RESOURCES BETWEEN AZURE SQL DATABASES? Elastic pools are useful for managing and scaling multiple databases that have varying and unpredictable usage demands. The databases in an elastic pool are on a single Azure SQL Database server and share a set number of resources at a set price. Elastic pools thus have larger limits, but are for sharing between databases. One single database cannot exceed the limits noted previously.

21 DEMO

22 This is a TL;DR SLIDE TIPS AND TRICKS Always use the latest version of SQL Server Management Studio BACPAC files must be saved to standard Azure Blob Storage, not premium storage Make sure your database is compatible with SQL Server 2016 features Watch out for hidden costs when scaling out SQL Databases, or running VMs Elastic pools can get expensive De-allocate VMs, and delete databases, if not using them

23 something amazing this way comes …
This is what’s coming something amazing this way comes … Migrate SQL Server to SQL as a Service with no changes SQL Agent, 3-part names, DBMail, CDC, Service Broker Cross-database and cross-instance querying Extensibility: CLR and R Services SQL Profiler (ugh!), additional DMVs support, XEvents Native backup and restore, log shipping, transactional replication

24 another screenshot Here’s the screenshot! Source: Microsoft

25 this is A summary slide summary DTUs do not map directly to resources, and require a workload to evaluate against (time-based evaluation) Some important on-premises features are not available in Azure SQL Database (YET!) For smaller databases, web-based applications, and specifically new development, Azure SQL Database may be appropriate SQL Server 2016 on Azure VM may be more appropriate for existing applications, and more cost-effective for larger databases, even with an Enterprise licence YMMV (your mileage may vary)

26 FIND OUT MORE Azure website: https://azure.microsoft.com/
LOTS OF LINKS HERE FIND OUT MORE Azure website: Books Online: documentation John Sterrett’s Virtual PASS Chapter presentation: Andy Mallon Reverse Engineered the DTU Calculator:


Download ppt "Migrating to Azure SQL Database: Tips, Tricks, and Lessons Learned"

Similar presentations


Ads by Google