Download presentation
Presentation is loading. Please wait.
Published bySteffen Fischer Modified over 6 years ago
1
Implementing and maintaining an Azure SQL Database project
Emanuele Zanchettin @_thinkIT_ thinkit.it – an evergreen session Gothenburg, Sweden
2
Primary sponsors
3
The others… Gothenburg, Sweden
4
Agenda Infrastructure overview Responsible choosing Project Scenarios
First publication Publication of revision Backup and restore strategies Service Level Agreement (SLA) and Objective (SLO)
5
About you Too much early in the morning, time for a short sleep .. ???
Are you awake? Try to raise your hand, only one Try to clap your hands, one time How many people are using … (raise your hand) SQL Server? Azure SQL Database? SS Management Studio? MS Visual Studio?
6
Speaker info – Emanuele Zanchettin
15+ years of experience data architect and consultant about SQLServer and Azure SQL Database analyst and software developer using .NET coordinator of resources and IT projects Member of board of 1nn0va – an Official Microsoft Community Speaker about SQLServer and Azure SQL Database technologies co-founder thinkIT Certified company ISO 9001:2008 (Quality) and ISO/IEC :2011 (IT Services) – Please excuse me for any mistake in my English, I’m studying to improve it
7
Some features of SQL Database
Basis haven’t changed … +/-
8
SQLDatabase inside – High Availability
3rd physic db 1st physic db 2nd physic db Database Logic Database 3rd physic db Multiple copies redundant automatic and automatic failover, optimized availability
9
Data partitioning - Scalability
Database Id val Id Val Id val Scale-up Vertical Partitioning Scale-out Horizontal partitioning bigger db more dbs Elastic scale (ex. app multi-tenant)
10
Conclusions Scale-up Vertical Partitioning
All right * Vertical Partitioning External foreign keys, between databases, not permitted You can not have transactions between databases Even using Microsoft Distributed Transaction Coordinator (MDTC client side) Scale-out or horizontal partitioning Embedded in Azure Schema design Developing and troubleshooting are little bit hard Elastic Scale … was Federation … Scale in-out / up-down ..
11
Other conclusions Service evolution f(x) tomorrow? today last year
some years ago t start
12
Hard to belive? Try to calculate the price
13
Active Geo-Replication, up to 4 only (readable) secondary backups
The choice, conscious Basic Standard Premium S0 S1 S2 S3 P1 P2 P4 P6/P3 P11 P15 Max DTUs 5 10 20 50 100 125 250 500 1000 1750 4000 Max Database Size 2 Max in-memory OLTP storage (GB) N/A 1 4 8 14 32 Max concurrent workers 30 60 90 120 200 400 800 1600 2400 6400 Max concurrent logins Max concurrent sessions 300 600 900 1200 4800 9600 19200 32000 Point-in-time-restore (any point last) 7 days 35 days Disaster recovery Active Geo-Replication, up to 4 only (readable) secondary backups
14
The choice, conscious – other POV
15
Save money at every cost
First benchmark: B vs S0, 1kk rows B 5DTU S0 10DTU SQL Server Execution Times CPU time = 672 ms elapsed time = ms. (8’ 3”) ( row(s) affected) SQL Server Execution Times CPU time = 891 ms elapsed time = ms. (4’ 20”) ( row(s) affected)
16
Save money at every cost
Last benchmark: B vs S0, 20kk rows (1,35GB) B 5DTU S0 10DTU The service has encountered an error processing your request. Please retry again. Error code 9002. SQL Server Execution Times CPU time = ms elapsed time = ms. (4h 57’) ( row(s) affected) the transaction log becomes full
17
Save money at every cost
Last benchmark: B, 4*5kk rows B 5DTU SQL Server Execution Times CPU time = 4078 ms, elapsed time = ms. (1h 21’) CPU time = 3719 ms, elapsed time = ms. (1h 21’) CPU time = 4234 ms, elapsed time = ms. (1h 21’) CPU time = 5578 ms, elapsed time = ms. (1h 21’) (5h 26’) ( row(s) affected) S0 was 4h 57’
18
Evolution from Federation to Elastic Scale
The Azure SQL Database Federations feature is being retired along with the Web/Business editions in September 2015 (Cit.)
19
Shard Map Two types of Shard Map Range: intervals contiguous elements
List: list of values Four types of keys INT BIGINT GUID VARBINARY
20
Split/Merge scenario Some comands CreateShard DeleteShard
CreateRangeMapping CreatePointMapping DeleteMapping UpdateMapping MarkMappingOffline MarkMappingOnline Key Shard Location 1 Database_A 3 Database_B 4 Database_C 6 ... Key Range Shard Location [1, 50) Database_A [50, 100) Database_B [100, 200) Database_C [400, 600) ...
21
Vertical: Scale-up or scale-down Horizontal: Scale-out or scale-in
Easy to understand Vertical: Scale-up or scale-down Horizontal: Scale-out or scale-in Premium Premium Standard Standard Scale up/down Basic Basic Basic Basic Basic Basic Scale out/in
22
Go … What’s your case?
23
Migrating existing project
all on cloud on premise + cloud (hybrid)
24
New project all on cloud
25
Privacy Policy In Italy is called Law 196/2003 “Sensitive Personal Information” means personal information that reveals race, ethnic origin, sexual orientation, political opinions, religious or philosophical beliefs, trade union membership or that concerns an individual’s health. Authorization needed Microsoft was the first major cloud provider to incorporate the ISO/IEC code of practice
26
Data classification for Azure
Sensitivity Terminology model 1 Terminology model 2 High Confidential Restricted Medium For internal use only Sensitive Low Public Unrestricted
27
First publishing Are you ready to do this?
28
Migration tools Schema and data Only data Only schema
SQL Server Migration Assistant (SSMA) from DB2, Oracle, Sybase, MySQL and Access SQL Server Management Studio (SSMS) from SQL Server 2012 using .bacpac package SQL Database Migration Wizard (CodePlex) SQL Server 2008 R2 SP1 (v3x), SQL Server 2012 (v4x), SQL Server 2014 (v5x) Only data bcp, SSMS, SQL Data Sync, SSIS Only schema SQL Server Data Tools from Microsoft Visual Studio 2012 VS2013+ from SQL Server 2012 using .dacpac package
29
A migration real case Tool: Migrate Data di SQL Server Migration Assistant for MySQL Quantity: 6 tables, 9KK rows, 520MB size Times: 26’ 30’’ parallel upload, fiber 10Mbit/s
30
SQL Server Database migration
DEMO Don’t forget to set the firewall SQL Server Database migration
31
Conclusions Features limits (Updated: June 13, 2016)
Collation of system objects, Connection related: Endpoint statements, ORIGINAL_DB_NAME. Windows authentication is not available for logins or contained database users. Cross database queries using three or four part names. (Read-only cross-database queries are supported by using elastic database query.), Cross database ownership chaining, TRUSTWORTHY setting, Data Collector, Database Diagrams, Database Mail, DATABASEPROPERTY (use DATABASEPROPERTYEX instead), EXECUTE AS logins, Encryption: extensible key management, Eventing: events, event notifications, query notifications, Features related to database file placement, size, and database files which are automatically managed by Microsoft Azure. Features that relate to high availability which is managed through your Microsoft Azure account: backup, restore, AlwaysOn, database mirroring, log shipping, recovery modes. For more information, see Azure SQL Database Backup and Restore. Features that rely upon the log reader running on SQL Database: Push Replication, Change Data Capture. Features that rely upon the SQL Server Agent or the MSDB database: jobs, alerts, operators, Policy-Based Management, database mail, central management servers. FILESTREAM, Functions: fn_get_sql, fn_virtualfilestats, fn_virtualservernodes, Global temporary tables, Hardware related server settings: memory, worker threads, CPU affinity, trace flags, etc. Use service levels instead. HAS_DBACCESS, KILL STATS JOB, Linked servers, OPENQUERY, OPENROWSET, OPENDATASOURCE, BULK INSERT, 3 and 4 part names, Master/target servers, .NET Framework CLR integration with SQL Server, Resource governor, Semantic search, Server credentials, Sever-level items: Server roles, IS_SRVROLEMEMBER, sys.login_token. Server level permissions are not available though some are replaced by database-level permissions. Some server-level DMV's are not available though some are replaced by database-level DMV's. Serverless express: localdb, user instances, Service broker, SET REMOTE_PROC_TRANSACTIONS, SHUTDOWN, sp_addmessage, sp_configure options and RECONFIGURE, sp_helpuser, sp_migrate_user_to_contained, SQL Server audit (use SQL Database auditing instead), SQL Server Profiler, SQL Server trace, Trace flags, 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. Documentation available online Keep updated your SQL Server .. last SSDT was 5days ago
32
Update publishing And now?
33
Managing schema and data
Managing environments of test and production Plan an undo step Changing schema and data SQL Server Management Studio (SSMS) from SQL Server 2012 using .bacpac package SQL Database Migration Wizard (CodePlex) SQL Server 2008 R2 SP1 (v3x), SQL Server 2012 (v4x) , SQL Server 2014 (v5x) Changing only data bcp, SSMS, SQL Data Sync, SSIS Changing only schema Microsoft Visual Studio 2012+ SQL Server Management Studio
34
An elastic scale upload real case
Tool: Custom Console Program .NET fw 4.5 with Task Parallel Library (TPL) Elastic Scale roles Int key Range value [1-6) [6-12) [12-18) [18-24) 4 databases B Quantity: 3 tables, 8,6KK rows, 490MB size Times: 8’ 34’’, fiber 10Mbit/s was 26’ 30’’
35
DEMO Cross our fingers for a fast internet connection Have fun with
Elastic Scale
36
Conclusions DBA, Data Architect and developers, do not quarrel amongst yourselves “Scaling” before reaching the limit Chosing a step-by-step publication Plans before starting
37
Backup and restore strategies
Don’t forget it!
38
Who does what? Azure SQL Database periodical backup
“as a safe guard against catastrophic software and system failures” !!!! Backup Full weekly, Differential hourly, Transaction Log avery 5’ History 7d (B), 35d (S), 35d (P) Point in Time Restore, Restoring a Deleted Database, Geo-Restore User’s error (Business Continuity) Using SQL Data Sync (backup offline/remote) Copy Database (CREATE DATABASE [destination] AS COPY OF [source]) Import/Export Service (Azure BLOB storage needed, auto in preview) Group/Agent of synchronization Azure (SQLDataSyncAgent only x86 ) Plans before starting
39
Service Level Agreement (SLA)
Guarantees on the service provided?
40
SLA 99,99% (B, S, P) Limit of subscription Credit card without money
Monthly, calculated over a minute of inactivity >= 1 minute Limit of subscription Credit card without money Over quota DTU (Database Throughput Units) Upgrade / Downgrade of Service tier
41
Service Level Objective (SLO)
Guarantees on your service provided?
42
on changing Service tier / Performance level
“the evil formula” not documented in detail Setup time + database size / transfer rate Setup time, connections to the database are disabled on average under 4 seconds less than 30 seconds (in more than 99% of cases) may be longer (very infrequently, large numbers of transactions in flight) Transfer rate (theoretic) 12MB/s to, from, or within a Standard service tier 24MB/s within a Premium service tier Ex. Using Standard service tier and a 250 GB database 30 seconds GB x 1024 MB/GB / 12 MB/s ≈ 6 hours
43
on changing Service tier / Performance level
Azure You Users Ex. Using Standard service tier and a 250 GB database 30 seconds GB x 1024 MB/GB / 12 MB/s SLA SLO SLA > SLO SLA == SLO SLA < SLO (MNU) ≈ 6 hours
44
Links SQL Database options and performance
Azure SQL Database Elastic Scale Ch9 channel9.msdn.com/Shows/Data-Exposed/Azure-SQL-Database-Elastic-Scale SQL Database Service Level Agreement (SLA) SQL Database pricing Data classification for Azure
45
Links SQL Server Migration Assistant (SSMA)
Azure SQL Database General Limitations and Guidelines Change the service tier and performance level (pricing tier) of a SQL database Getting Started with Azure SQL Data Sync (Preview) Overview of business continuity with Azure SQL Database msdn.microsoft.com/en-us/library/azure/jj aspx
46
Q&A Questions? keep in touch at coffee break at lunch
around the conference via via
47
You can clap your hands now
THANKS Don’t miss Evaluations The Raffle You can clap your hands now
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.