Presentation is loading. Please wait.

Presentation is loading. Please wait.

#sqlsat454 October 10, 2015 Implementing and maintaining an Azure SQL Database project Emanuele thinkit.it –

Similar presentations


Presentation on theme: "#sqlsat454 October 10, 2015 Implementing and maintaining an Azure SQL Database project Emanuele thinkit.it –"— Presentation transcript:

1 #sqlsat454 October 10, 2015 Implementing and maintaining an Azure SQL Database project Emanuele Zanchettin @_thinkIT_ thinkit.it – ezanchettin@thinkit.it an evergreen session

2 #sqlsat454 October 10, 2015 Sponsors

3 #sqlsat454 October 10, 2015 Speaker info – Emanuele Zanchettin  10+ 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  Speaker about SQLServer and Azure SQL Database technologies  CEO and co-founder thinkIT Certificated company ISO 9001:2008 (Quality) and ISO/IEC 20000-1:2011 (IT Services)  ezanchettin@thinkit.it – http://www.thinkit.it/

4 #sqlsat454 October 10, 2015 About you After a great lunch, time for a long sleep.. ??? Are you awake?  Try to raise your hand  Try to clap your hands How many people are using … (raise your hand)  SQL Server?  Azure SQL Database?  SS Management Studio?  MS Visual Studio?

5 #sqlsat454 October 10, 2015 Agenda Infrastructure overview Responsible choosing Project Scenarios First publication Publication of revision Backup and restore strategies Service Level Agreement (SLA) and Objective (SLO)

6 #sqlsat454 October 10, 2015 Some features of SQL Database Basis haven’t changed … +/-

7 #sqlsat454 October 10, 2015 SQLDatabase inside – High Availability Logic DatabaseDatabase 2 nd physic db 3 rd physic db 1 st physic db Multiple copies redundant automatic and automatic failover, optimized availability

8 #sqlsat454 October 10, 2015 Data partitioning - Scalability Scale-out Horizontal partitioning Vertical Partitioning Scale-up Idval Idval Idval Database bigger dbmore dbs Elastic scale (ex. app multi-tenant)

9 #sqlsat454 October 10, 2015 Conclusions Scale-up  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 …

10 #sqlsat454 October 10, 2015 Other conclusions  Service evolution t f (x) start 6 months ago 2 days ago tomorrow? today

11 #sqlsat454 October 10, 2015 Hard to belive? Try to calculate the price

12 #sqlsat454 October 10, 2015 The choice, conscious Service Tier Performance Level Common App Pattern PerformanceBusiness Continuity Max DB Size Transaction Perf. Objective DTUPITRDR / GEO- Rep Basic Small DB, SQL opp 2 GB Reliability / Hr. 5 7 Days DB Copy + Manual Export Standard S0 S1 S2 S3 Wrkgp/cloud app, multiple concurrent operations 250 GB Reliability / Min. 10 20 50 100 14 Days DB Copy + Manual Export Premium P1 P2 P4 P6 Mission Critical, High volume, Many concurrent Users 500 GB Reliability / sec. 125 250 500 1000 35 Days Active Geo- replication P111TB1750

13 #sqlsat454 October 10, 2015 Save money at every cost  First benchmark: B vs S0, 1kk rows SQL Server Execution Times CPU time = 672 ms elapsed time = 511505 ms. (8’ 3”) (1000000 row(s) affected) SQL Server Execution Times CPU time = 891 ms elapsed time = 260066 ms. (4’ 20”) (1000000 row(s) affected) B 5DTU S0 10DTU

14 #sqlsat454 October 10, 2015 Save money at every cost  Last benchmark: B vs S0, 20kk rows The service has encountered an error processing your request. Please retry again. Error code 9002. SQL Server Execution Times CPU time = 169625 ms elapsed time = 17847310 ms. (4h 57’) (20000000 row(s) affected) B 5DTU S0 10DTU the transaction log becomes full

15 #sqlsat454 October 10, 2015  Last benchmark: B, 5*4kk rows Save money at every cost SQL Server Execution Times CPU time = 4078 ms, elapsed time = 4892725 ms. (1h 21’) CPU time = 3719 ms, elapsed time = 4894096 ms. (1h 21’) CPU time = 4234 ms, elapsed time = 4895032 ms. (1h 21’) CPU time = 5578 ms, elapsed time = 4923000 ms. (1h 21’) (5h 26’) (20000000 row(s) affected) B 5DTU S0 was 4h 57’ S0 was 4h 57’

16 #sqlsat454 October 10, 2015 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.)

17 #sqlsat454 October 10, 2015 Shard Map  Two types of Shard Map  Range: intervals contiguous elements  List: list of values Four types of keys  INT  BIGINT  GUID  VARBINARY

18 #sqlsat454 October 10, 2015 Split/Merge scenario Some comands –CreateShard –DeleteShard –CreateRangeMapping –CreatePointMapping –DeleteMapping –UpdateMapping –MarkMappingOffline –MarkMappingOnline KeyShard Location 1Database_A 3Database_B 4Database_C 6Database_B... Key RangeShard Location [1, 50)Database_A [50, 100)Database_B [100, 200)Database_C [400, 600)Database_C...

19 #sqlsat454 October 10, 2015 Premium Easy to understand Vertical: Scale-up or scale-down Horizontal: Scale-out or scale-in Basic Standard Basic Premium Standard Scale out/in Scale up/down

20 #sqlsat454 October 10, 2015 Go … What’s your case?

21 #sqlsat454 October 10, 2015 Migrating existing project all on cloud on premise + cloud (hybrid)

22 #sqlsat454 October 10, 2015 New project all on cloud

23 #sqlsat454 October 10, 2015 Upgrading project V2 > V12 SQL V2 SQL V12 easy* Upgrading this server to the latest SQL Database Update is permanent and irreversible. To confirm the upgrade, type the name of the server ‘pluto' below. The duration of upgrade ranges from several hours to days depending on the size, edition and number of databases in the server. During this time all databases on this server will remain online but server and database management actions will be restricted. This release does not currently support some features that may be used by your application. Please review the list carefully before continuing with the upgrade. *

24 #sqlsat454 October 10, 2015 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

25 #sqlsat454 October 10, 2015 First publishing Are you ready to do this?

26 #sqlsat454 October 10, 2015 Migration tools  Schema and data SQL Server Migration Assistant (SSMA)  from Oracle, Sybase, MySQL and Access SQL Server Management Studio (SSMS)  from SQL Server 2012 using.bacpac package  2014+ 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  2014+

27 #sqlsat454 October 10, 2015 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

28 #sqlsat454 October 10, 2015 DEMO SQL Server Database migration

29 #sqlsat454 October 10, 2015 Conclusions  Features limits (Updated: March 27, 2015) 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, cross database ownership chaining, TRUSTWORTHY setting, Data Collector, Database Diagrams, Database Mail, DATABASEPROPERTY (use DATABASEPROPERTYEX instead), Distributed transactions, 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), Features that rely upon the log reader (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, 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 instance), Service broker, SET REMOTE_PROC_TRANSACTIONS, SHUTDOWN, sp_addmessage, sp_configure options and RECONFIGURE, 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  Documentation available online

30 #sqlsat454 October 10, 2015 Update publishing And now?

31 #sqlsat454 October 10, 2015 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  2014+ 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

32 #sqlsat454 October 10, 2015 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 An elastic scale upload real case was 26’ 30’’ was 26’ 30’’

33 #sqlsat454 October 10, 2015 DEMO Have fun with Elastic Scale

34 #sqlsat454 October 10, 2015 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

35 #sqlsat454 October 10, 2015 Backup and restore strategies Don’t forget it!

36 #sqlsat454 October 10, 2015 Who does what?  SQL Azure periodical at least 7 days “as a safe guard against catastrophic software and system failures” !!!! Backup Full weekly, Differential daily, Transaction Log avery 5’ History 7d (B), 14d (S), 35d (P) Point in Time Restore, Restoring a Deleted Database, Geo-Restore  User’s error (Business Continuity) Using SQL Data Sync (backup offline/remoto) 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

37 #sqlsat454 October 10, 2015 Service Level Agreement (SLA) Guarantees on the service provided?

38 #sqlsat454 October 10, 2015 SLA  99,99% (B, S, P)  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

39 #sqlsat454 October 10, 2015 Service Level Objective (SLO) Guarantees on your service provided?

40 #sqlsat454 October 10, 2015 SLO  “the evil formula” on changing Service tier 3 x (5 minutes + database size / 150 MB/minute) Ex. 3 x (5 minutes + 50 GB x 1024 MB/GB / 150 MB/minute) ≈ 17 hours SLO > SLA  (  )SLO == SLA  SLO < SLA

41 #sqlsat454 October 10, 2015 Links  Migration from federation to elastic scale azure.microsoft.com/en-us/documentation/articles/sql- database-elastic-scale-federation-migration/ azure.microsoft.com/en-us/documentation/articles/sql- database-elastic-scale-federation-migration/  Azure SQL Database Elastic Scale Ch9 channel9.msdn.com/Shows/Data-Exposed/Azure-SQL- Database-Elastic-Scale channel9.msdn.com/Shows/Data-Exposed/Azure-SQL- Database-Elastic-Scale  SQL Database Service Level Agreement (SLA) www.windowsazure.com/it-it/support/legal/sla/  SQL Database pricing www.windowsazure.com/it-it/pricing/details/sql-database/

42 #sqlsat454 October 10, 2015 Links  SQL Server Migration Assistant (SSMA) blogs.msdn.com/b/ssma/  Guidelines and Limitations (Windows Azure SQL Database) msdn.microsoft.com/en-us/library/windowsazure/ff394102.aspx  Known SQL Data Sync (Preview) Limits msdn.microsoft.com/en-us/library/jj590380.aspx  Azure SQL Database Backup and Restore msdn.microsoft.com/en-us/library/azure/jj650016.aspx

43 #sqlsat454 October 10, 2015 Q&A  Questions?

44 #sqlsat454 October 10, 2015 THANKS! You can clap your hands now and don’t forget to put your feedback at http://speakerscore.com/454IMASDB THANKS! #sqlsat454


Download ppt "#sqlsat454 October 10, 2015 Implementing and maintaining an Azure SQL Database project Emanuele thinkit.it –"

Similar presentations


Ads by Google