Diving into sql server 2016

24
Diving into SQL Server 2016 Mohamed Zaatar, M.Sc. Readify Developer @mzaatar

Transcript of Diving into sql server 2016

Page 1: Diving into sql server 2016

Diving into SQL Server 2016Mohamed Zaatar, M.Sc.Readify Developer@mzaatar

Page 2: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited2

Page 3: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited3

Page 4: Diving into sql server 2016

Page / Copyright ©201 by Readify Limited4

TO-DO List› Into Azure

› DB Stretching› SQL Server data files in Azure

› SQL Server Engine › JSON Support› Query Store

› In-Memory Computing› In-Memory OLTP - Memory-Optimized Tables› In-Memory Columnstore Indexes

› Security› Row-level security› Dynamic data masking

Page 5: Diving into sql server 2016

Page / Copyright ©201 by Readify Limited5

TO-DO List› Into Azure

› DB Stretching› SQL Server data files in Azure

› SQL Server Engine › JSON Support› Query Store

› In-Memory Computing› In-Memory OLTP - Memory-Optimized Tables› In-Memory Columnstore Indexes

› Security› Row-level security› Dynamic data masking

Page 6: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited6

Stretch Database

Page 7: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited7

Database Stretching› Why? Transactional data/save money› Not same as Linked Server› Microsoft charges you when query data not

when move itAzureLocal DB

Page 8: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited8

SQL Server data files in Azure› Save mdf /ldf files in Azure Blob storage› Why?

› Backups› High Availability› Security Azure

SQL Server (on premises)

DB 1

DB 2

DB 3

MDF LDF

Azure Blob Storage

Page 9: Diving into sql server 2016

Page / Copyright ©201 by Readify Limited9

TO-DO List› Into Azure

› DB Stretching› SQL Server data files in Azure

› SQL Server Engine › JSON Support› Query Store

› In-Memory Computing› In-Memory OLTP - Memory-Optimized Tables› In-Memory Columnstore Indexes

› Security› Row-level security› Dynamic data masking

Page 10: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited10

Page 11: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited11

JSON support› Native support (like xml)› What to do ?› Export/export data from string to JSON› Format strings (varchar) as JSON› Query› Validate string against JSON standards

Page 12: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited12

Page 13: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited13

Query store› New in 2016 and SQL Azure v12› Bunch of tables:

› sys.query_store_plan , sys.query_store_query , sys.query_store_query_text

› Why?› Find and fix› How many time execute a query› Top n queries› Audit the history of queries

Page 14: Diving into sql server 2016

Page / Copyright ©201 by Readify Limited14

TO-DO List› Into Azure

› DB Stretching› SQL Server data files in Azure

› SQL Server Engine › JSON Support› Query Store

› In-Memory Computing› In-Memory OLTP - Memory-Optimized Tables› In-Memory Columnstore Indexes

› Security› Row-level security› Dynamic data masking

Page 15: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited15

In-memory OLTP› i.e. Memory-optimized tables› ACID? YES !› Data in memory, saved on commits/check

points› Data consistency? Using row versioning› Durable/nondurable data? Both are available› How to access data? T-SQL and Native-

complied table/sp

Page 16: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited16

In-memory ColumnStore indexes

Page 17: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited17

In-memory ColumnStore indexes

 ID  Name Date Amount       

              

              

 Name 

Date 

 ID Amount 

              

              

RowStore ColumnStore

Page 18: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited18

In-memory ColumnStore indexes› Columnstore Index (memory-optimized)› What is new? Clustered Index› Massive better performance !

Page 19: Diving into sql server 2016

Page / Copyright ©201 by Readify Limited19

TO-DO List› Into Azure

› DB Stretching› SQL Server data files in Azure

› SQL Server Engine › JSON Support› Query Store

› In-Memory Computing› In-Memory OLTP - Memory-Optimized Tables› In-Memory Columnstore Indexes

› Security› Row-level security› Dynamic data masking

Page 20: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited20

Row-level Security – aka RLS› 2014 – enhancement in 2016› Why? Multi-tenants DB

Application Server

Clients

Database

Solution 1

Solution 2

Page 21: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited21

Mohamed Zaatar

XXXX-XXXX-XXXX-6543

xxx

Dynamic data masking› Customer service verifying credit cards› By a simple column attribute

Application Server

Database

Mohamed Zaatar

1234-6123-8787-6543

123

Matt Davies 7652-2372-2746-2815

789

Database

Page 22: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited22

Demos ?https://github.com/mzaatar/DBScripts/

Page 23: Diving into sql server 2016

Page / Copyright ©2014 by Readify Limited23

Resources› https://msdn.microsoft.com/en-us/library/dn935011.aspx › http://sqlwithmanoj.com/tag/stretch-database/› https://msdn.microsoft.com/en-US/library/dn466438.aspx› https://msdn.microsoft.com/en-au/library/dn934994.aspx› http://blog.sqlauthority.com/2011/10/29/sql-server-fundamentals-of-columnstore-ind

ex/› http://www.nikoport.com/2015/09/02/columnstore-indexes-part-64-t-sql-improvemen

ts-in-sql-server-2016/› https://msdn.microsoft.com/en-us/library/dn133165.aspx› https://azure.microsoft.com/en-us/blog/query-store-a-flight-data-recorder-for-your-dat

abase/› https://msdn.microsoft.com/en-us/library/dn765131.aspx› https://msdn.microsoft.com/en-us/library/mt163865.aspx

Page 24: Diving into sql server 2016

Thanks