Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Azure Datasync workshop Global Azure Bootcamp Lisbon 2018

221 views

Published on

This presentation shows how to keep data in sync from an on prem SQL SERVER Instance and an Azure SQL Database - presented in global Azure Bootcamp Lisbon 2018.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Azure Datasync workshop Global Azure Bootcamp Lisbon 2018

  1. 1. 286 events... 82 countries... The oldest school in Lisbon... Synchronizing data between Azure SQL Database and SQL SERVER Instances Marcelo Gonçalves Adade marcelo@dbbits.com.br/@marceloadade 2018-04-21
  2. 2. Obrigado aos nossos Patrocinadores/Parceiros Este evento não seria possível sem os seguintes patrocinadores nacionais: Patrocinadores globais do evento: As seguintes comunidades e parceiros contribuiram para realizar este evento:
  3. 3. SELECT * FROM GABLisboa2018.Speakers WHERE Name = ‘Marcelo G. Adade'; Database Consultant at Pythian co-leader PASS Group SQLMANIACS MCT, MCP and OCP www.dbbits.com.br www.sqlmaniacs.com.br 10+ years of experience as a DBA Marcelo.Adade @marceloadade https://br.linkedin.com/in/marcelo.adade marcelo@dbbits.com.br http://www.youtube.com/user/dbbits1 http://www.dbbits.com.br
  4. 4. DB on both Worlds – onprem and cloud The PaaS offering Replication Sync data from cloud to onprem Data Sync requirements and limitations Monitoring Data Sync and Best Practices Hands On SELECT * FROM Agenda;
  5. 5. It’s all a lie!
  6. 6. Data living in both Worlds - discussion Why sync data from onprem to the cloud? Why sync data from cloud to onprem? How to sync only the difference (delta)?
  7. 7. Intro to (PaaS) Azure SQL Database Offering: Single database Elastic Pool Both with the choice for vCore and DTU pricing Managed Instance (soon): vCore pricing
  8. 8. Intro to Azure SQL Database Priced in DTUs (Database Transaction Unit) - simplicity Priced in vCore (like a VM) – Hybrid benefit if SA!
  9. 9. Intro to Azure SQL Database – Elastic pool • Scaling multiple databases • On a single SQL Server • Priced in elastic DTU(eDTU) or vCore • Configure resource limits to each DB
  10. 10. Intro to Azure SQL Database – Elastic pool
  11. 11. What about grampa’s replication?
  12. 12. What about grampa’s replication? Two flavors for replicating TO Azure Transactional Snapshot
  13. 13. Introducing Azure Data Sync Making it possible to synchronize data both ways It is yet in PREVIEW! Replicating on the data level - using INSERT, DELETE and UPDATE triggers (on a secondary table) Suitable for Hybrid Data Syncronization, (Globally) Distributed Applications Not suitable for DR, Read Scale, ETL, Migration from on-prem to Azure
  14. 14. How it works – Azure Data Sync Tracking changes: recorded in a secondary table; Synchronizing data: Hub and Spoke model; Resolve conflicts: either Hub or member wins; Eventual consistency: trigger-based – transactional consistency is not guaranteed, no data loss will happen though; Change tracking may affect performance.
  15. 15. How it works – Azure Data Sync
  16. 16. Requirements Primary key is needed; Snapshot isolation must be enabled; Minimum sync interval is 5 minutes; Hub database must be an Azure SQL DB; Member dbs can be on-prem and Azure; Sync database has metadata and log for the Sync – has to be on the same region as the Hub.
  17. 17. Limitations Identity has to be the Primary key; PK can’t have a datetime type; Names cannot contain . or []; Azure AD is not supported; Circular reference is not supported; Filestream, SQL UDT, XMLSchemaCollection, Cursor, Timestamp not supported HEY, but it is still free!  Give feedback here: https://feedback.azure.com/forums/217321-sql-database?query=data%20sync
  18. 18. Step-by-step 1. Create the Sync group; 2. Add the HUB database; 3. Add the member databases; 4. If one of the member is an on premise db, install the Agent; 5. Add the onprem db; 6. Adjust the options for the sync
  19. 19. Demo time
  20. 20. Monitoring Data Sync Needed: • A PowerShell runbook to feed SQL Data Sync log data to Log Analytics. • A Log Analytics alert for email notifications. • A Log Analytics View for monitoring. • Automation account needed From: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-sync-monitor-oms (Operations manager Suite)
  21. 21. Best practices for Data Sync Client agent: least privileged rule; Client agent: install on the computer that doesn’t host the SQL SERVER Database; Register an onprem database with only one agent; Check database sizing; Select only the tables you need; Indexes won’t be added to destination if column is not selected; XML Indexes are not provisioned
  22. 22. Best practices for Data Sync Views and Procedures are not provisioned; CHECK constraints are not provisioned; For production, provision the schema yourself; Keep the HUB Database close to most Members;
  23. 23. Troubleshooting Check %TEMP% on Agent machine for space; Is the Agent online? Check if the XML file from the Agent is on the proper folder; No circular reference is handled by Data Sync, so avoid it – “The Data Sync deadlock”. When installing the Agent use the notation <servername>account, not .account Many more on: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-troubleshoot-data-sync
  24. 24. "Seriously, why do these people buy Macs? Because the boxes PCs come in are too hard for them to open." Anonymous genius
  25. 25. Questions? SELECT * FROM Questions;
  26. 26. Let’s add a Northwind database synced up – from Azure to onprem! Download Northwind: http://businessimpactinc.com/blog/install-northwind-database/ Download the agent: https://www.microsoft.com/en-us/download/details.aspx?id=27693 http://go.microsoft.com/fwlink/?LinkID=239658&clcid=0x409 http://go.microsoft.com/fwlink/?LinkID=239643&clcid=0x409 You need to adjust the Northwind database, changing Nonclustered Primary Keys to clustered ones (script provided)
  27. 27. SPONSOR SLIDES HERE<<<<<<<<<<<
  28. 28. Thank you, pá! Marcelo.Adade @marceloadade https://br.linkedin.com/in/marcelo.adade marcelo@dbbits.com.br http://www.youtube.com/user/dbbits1 http://www.dbbits.com.br http://www.sqlmaniacs.com.br

×