SlideShare une entreprise Scribd logo
1  sur  29
SQL Server 2016 JSON
Davide Mauri
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
About Me
Microsoft SQL Server MVP
Works with SQL Server from 6.5, on BI from 2003
Specialized in Data Solution Architecture, Database Design, Performance
Tuning, High-Performance Data Warehousing, BI, Big Data
President of UGISS (Italian SQL Server UG)
Regular Speaker @ SQL Server events
Consulting & Training, Mentor @ SolidQ
E-mail: dmauri@solidq.com
Twitter: @mauridb
Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Agenda
• JSON in life
• JSON and SQL Server
• JSON “Datatype” (not really)
• Navigation via “dot” notation
• LAX and STRICT path modes
• JSON Functions
• JSON_VALUE, JSON_QUERY, JSON_MODIFY, ISJSON
• JSON & SQL
• OPENJSON
• FOR JSON
• Indexes
• The Dynamic Schema problem (or “the Relational Division”)
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON in Life
• That’s a DEV conference….
• …so I’m sure you know JSON pretty well 
• For who doesn’t already know it:
• JavaScript Object Notation
• Simple, Human-Readable, Text data format
• Based on Key-Value pair idea
• Values can be: Scalar, Arrays, Key-Value pairs
• No strict schema (yet)
• Supported in any language, cross platform
• De-facto standard
• http://www.ietf.org/rfc/rfc4627.txt
Image taken from wikipedia
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON and SQL Server
• No support until SQL Server2016
• Before SQL Server 2016:
• One option is to use SQLCLR
• Solutions available surfing the web:
• http://www.sqlservercentral.com/articles/SQLCLR/74160/
• http://www.json4sql.com/examples.html
• Another (more limited) option is a pure T-SQL solution
• https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-
server/
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON and SQL Server
• Why native JSON support it’s important?
• Simplify application development
• Especially in non-MS environments, since JSON is *very* well supported (eg. Python / JS)
• Reduces the impedance mismatch between app and db
• Make schema extensibility a breeze
• But without having *only* “liquid” schemas. Schema is a good thing in general. Having
the option to decide when and when not use it is a key feature today:
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON and SQL Server 2016
• Native support to JSON
• No specific datatype format (like XML)
• relies on varchar(max)
• Specific function to
• manipulate and create JSON
• extract data from JSON
• turn relational data into JSON and vice-versa
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON Path
• The dollar sign ($) represents the context item.
• The property path is a set of path steps.
• Key names.
• Array elements. Arrays are zero-based.
• The dot operator (.) indicates a member
of an object.
• “LAX” or “STRICT” option set invalid path
handling
• LAX: null
• STRICT: error
$.conference.speaker
$.conference.speaker.editions[0]
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON Path
• Like XPATH but for JSON
• http://goessner.net/articles/JsonPath
• https://jsonpath.curiousconcept.com
• http://jsonpath.com
• SQL Server 2016 doesn’t offer a full
support yet.
• Is a subset of JSONPath
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON Functions
• Scalar functions to manage JSON data
• ISJSON: test if string is JSON
• JSON_VALUE: extract a scalar value
• JSON_QUERY: extract a JSON value
• JSON_MODIFY: modify a JSON property
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
DEMO
SQL/JSON First Contacts
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON Functions
• Tabular functions
• OPENJSON: turn a JSON object into a table
• FOR JSON: turn a table into a JSON object
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
OPENJSON
• Support both implicit and explicit schema:
Type Meaning
0 null
1 string
2 int
3 true/false
4 array
5 object
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
OPENJSON
• Very useful with OPENROWSET to import JSON
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
FOR JSON
• Two modes: AUTO, PATH
• AUTO: shape of JSON using the SELECT statement as guideline
• PATH: column alias and JSON_QUERY function allows for total control
of final JSON
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
DEMO
JSON and Relations
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
JSON Indexes
• JSON data support indexes…even if it doesn’t seems so!
• Right, there is no special index like it happens with XML
• How to index JSON Data
• Create calculated columns for scalar JSON values you know if want to index
• Create FULLTEXT index to index whole JSON document
• Use the FULLTEXT index to perform “near” term search
• CONTAINS(JSON_DATA, ‘NEAR((“Key”, “Value”),1)’)
• Uses a “Generalized Inverted Index” (like Postgres)
• https://msdn.microsoft.com/en-us/library/cc879306.aspx
• Indexes to support JSON Path queries (like XML) are not yet there
• You have to DIY here (Service Broker to async update EAV table)
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
DEMO
JSON Indexing
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Dynamic Schema
• JSON sounds like a perfect solution of all the “Dynamic Schema”
situations
• Why “Dynamic Schema” and not Schemaless?
• Because schemaless does not *really* exists! In reality a schema always
exists, albeit implicit, otherwise it would be impossible to handle data
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Implict Schema
Any data that doesn't fit this implicit schema will not be manipulated
properly, leading to errors.
(Schemaless data structures, Martin Fowler)
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Words of Wisdom
«Schemaless => implicit schema = bad.
Prefer an explicit schema»
(Schemaless data structures, Martin Fowler)
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Dynamic Schema
• What if my use case is one that perfectly fits the need for a implicit
schema?
• The only possible solution are the so-called «No-SQL» databases
• Document Database or Key-Value store?
• How can I integrate it into already existing database?
• Integration does not come for free!
• Now with SQL Server 2016 we have an additional option! 
• No integration problems, No added complexity
• Great Performances
• Works within a well-known platform
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
DEMO
Dynamic Schema
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Last things
• JSON and the new COMPRESS function works well together:
• Compress using GZIP algorithm (Natively supported by browsers)
• Simplify app development and integration with rdbms
• Sample usage with node.js
• http://www.codeproject.com/Articles/1063475/Pushing-Compression-from-
node-js-to-SQL-Server
• JSON is also supported on SQL Azure
• Requires server version V12
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Conclusions
• JSON does not substitute relational solutions
• Can be useful to extend them
• Can be *very* useful to simplify app-to-db communications
• JSON as parameter value! That’s a dream 
• FAQ:
• https://msdn.microsoft.com/en-us/library/mt631706.aspx
• Follow SQL Server JSON PM:
• https://blogs.msdn.microsoft.com/sqlserverstorageengine/tag/json
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Help us to make JSON support better!
• Don't restrict JSON_VALUE and JSON_QUERY to string literals only
for the path
• https://connect.microsoft.com/SQLServer/Feedback/Details/2235470
• Support JSON in COLUMNSET for SPARSE columns
• https://connect.microsoft.com/SQLServer/feedback/details/2533991
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Help us to make JSON support better!
• Allow support for JSON of simple arrays generation
• https://connect.microsoft.com/SQLServer/Feedback/Details/1383569
• JSON_VALUE: adding another optional parameter, which defines
what type of value the function will return
• https://connect.microsoft.com/SQLServer/Feedback/Details/2543881
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Thanks!
Questions?
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Demos available on GitHub
https://github.com/yorek/devweek2016

Contenu connexe

Tendances

SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Azure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONAzure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONDavide Mauri
 
The databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesThe databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesKamil Nowinski
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL DevelopersIke Ellis
 
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSencha
 
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...SPTechCon
 
PowerShell for the Hybrid Admin
PowerShell for the Hybrid AdminPowerShell for the Hybrid Admin
PowerShell for the Hybrid AdminJason Himmelstein
 
ECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
ECS19 - Ahmad Najjar and Serge Luca - Power Platform TutorialECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
ECS19 - Ahmad Najjar and Serge Luca - Power Platform TutorialEuropean Collaboration Summit
 
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Mark Roden
 
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...NCCOMMS
 
Intro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersIntro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersJohn Ferringer
 
Spca2014 thvo sql pub vochten
Spca2014 thvo sql pub vochtenSpca2014 thvo sql pub vochten
Spca2014 thvo sql pub vochtenNCCOMMS
 
Your Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsYour Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsKen Tabor
 
A Deep-Dive into Real-World SharePoint App Development
A Deep-Dive into Real-World SharePoint App DevelopmentA Deep-Dive into Real-World SharePoint App Development
A Deep-Dive into Real-World SharePoint App DevelopmentSPC Adriatics
 
Be a Modern SharePoint Developer
Be a Modern SharePoint DeveloperBe a Modern SharePoint Developer
Be a Modern SharePoint DeveloperSuhail Jamaldeen
 
Hybrid SharePoint Deployments
Hybrid SharePoint DeploymentsHybrid SharePoint Deployments
Hybrid SharePoint DeploymentsSPC Adriatics
 
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...Sencha
 

Tendances (20)

SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Azure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSONAzure SQL & SQL Server 2016 JSON
Azure SQL & SQL Server 2016 JSON
 
The databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesThe databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practices
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
 
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...
Part I: SharePoint 2013 Administration by Todd Klindt and Shane Young - SPTec...
 
PowerShell for the Hybrid Admin
PowerShell for the Hybrid AdminPowerShell for the Hybrid Admin
PowerShell for the Hybrid Admin
 
ECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
ECS19 - Ahmad Najjar and Serge Luca - Power Platform TutorialECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
ECS19 - Ahmad Najjar and Serge Luca - Power Platform Tutorial
 
Iconus 2016
Iconus 2016Iconus 2016
Iconus 2016
 
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
 
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
 
Intro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersIntro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developers
 
Spca2014 thvo sql pub vochten
Spca2014 thvo sql pub vochtenSpca2014 thvo sql pub vochten
Spca2014 thvo sql pub vochten
 
Your Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web ComponentsYour Future HTML: The Evolution of Site Design with Web Components
Your Future HTML: The Evolution of Site Design with Web Components
 
A Deep-Dive into Real-World SharePoint App Development
A Deep-Dive into Real-World SharePoint App DevelopmentA Deep-Dive into Real-World SharePoint App Development
A Deep-Dive into Real-World SharePoint App Development
 
Be a Modern SharePoint Developer
Be a Modern SharePoint DeveloperBe a Modern SharePoint Developer
Be a Modern SharePoint Developer
 
Moka .Net Study Week 01
Moka .Net Study Week 01Moka .Net Study Week 01
Moka .Net Study Week 01
 
Hybrid SharePoint Deployments
Hybrid SharePoint DeploymentsHybrid SharePoint Deployments
Hybrid SharePoint Deployments
 
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...
SenchaCon 2016: Web Development at the Speed of Thought: Succeeding in the Ap...
 
Final project
Final projectFinal project
Final project
 

Similaire à SQL Server 2016 JSON

Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Derek Jacoby
 
Azure Resource Manager templates: Improve deployment time and reusability
Azure Resource Manager templates: Improve deployment time and reusabilityAzure Resource Manager templates: Improve deployment time and reusability
Azure Resource Manager templates: Improve deployment time and reusabilityStephane Lapointe
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_uDoris Chen
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
 
Managing Changes to the Database Across the Project Life Cycle (presented by ...
Managing Changes to the Database Across the Project Life Cycle (presented by ...Managing Changes to the Database Across the Project Life Cycle (presented by ...
Managing Changes to the Database Across the Project Life Cycle (presented by ...eZ Systems
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish DatabaseGaetano Giunta
 
The New York Times: Moving to GraphQL
The New York Times: Moving to GraphQLThe New York Times: Moving to GraphQL
The New York Times: Moving to GraphQLScott Taylor
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesTeamstudio
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsSandeep Adwankar
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDavide Mauri
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]David Wesst
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017Stefano Bonetta
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseBrant Burnett
 
Web components the future is here
Web components   the future is hereWeb components   the future is here
Web components the future is hereGil Fink
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptRegroove
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-upTroy Miles
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent Biret
 

Similaire à SQL Server 2016 JSON (20)

Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Azure Resource Manager templates: Improve deployment time and reusability
Azure Resource Manager templates: Improve deployment time and reusabilityAzure Resource Manager templates: Improve deployment time and reusability
Azure Resource Manager templates: Improve deployment time and reusability
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 
Managing Changes to the Database Across the Project Life Cycle (presented by ...
Managing Changes to the Database Across the Project Life Cycle (presented by ...Managing Changes to the Database Across the Project Life Cycle (presented by ...
Managing Changes to the Database Across the Project Life Cycle (presented by ...
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
 
The New York Times: Moving to GraphQL
The New York Times: Moving to GraphQLThe New York Times: Moving to GraphQL
The New York Times: Moving to GraphQL
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
Rich and Beautiful: Making Attractive Apps in HTML5 [Wpg 2013]
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
 
Web components the future is here
Web components   the future is hereWeb components   the future is here
Web components the future is here
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScript
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)
 

Plus de Davide Mauri

Azure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartAzure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartDavide Mauri
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
When indexes are not enough
When indexes are not enoughWhen indexes are not enough
When indexes are not enoughDavide Mauri
 
Building a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureBuilding a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureDavide Mauri
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Azure Stream Analytics
Azure Stream AnalyticsAzure Stream Analytics
Azure Stream AnalyticsDavide Mauri
 
Real Time Power BI
Real Time Power BIReal Time Power BI
Real Time Power BIDavide Mauri
 
AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)Davide Mauri
 
Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Davide Mauri
 
Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Davide Mauri
 
Back to the roots - SQL Server Indexing
Back to the roots - SQL Server IndexingBack to the roots - SQL Server Indexing
Back to the roots - SQL Server IndexingDavide Mauri
 
Iris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure MLIris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure MLDavide Mauri
 
BIML: BI to the next level
BIML: BI to the next levelBIML: BI to the next level
BIML: BI to the next levelDavide Mauri
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
Data Science Overview
Data Science OverviewData Science Overview
Data Science OverviewDavide Mauri
 
Delayed durability
Delayed durabilityDelayed durability
Delayed durabilityDavide Mauri
 
Hekaton: In-memory tables
Hekaton: In-memory tablesHekaton: In-memory tables
Hekaton: In-memory tablesDavide Mauri
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql serverDavide Mauri
 

Plus de Davide Mauri (19)

Azure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartAzure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstart
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
When indexes are not enough
When indexes are not enoughWhen indexes are not enough
When indexes are not enough
 
Building a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureBuilding a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with Azure
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Azure Stream Analytics
Azure Stream AnalyticsAzure Stream Analytics
Azure Stream Analytics
 
Real Time Power BI
Real Time Power BIReal Time Power BI
Real Time Power BI
 
AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)
 
Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)
 
Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Azure Machine Learning (Italian)
Azure Machine Learning (Italian)
 
Back to the roots - SQL Server Indexing
Back to the roots - SQL Server IndexingBack to the roots - SQL Server Indexing
Back to the roots - SQL Server Indexing
 
Iris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure MLIris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure ML
 
BIML: BI to the next level
BIML: BI to the next levelBIML: BI to the next level
BIML: BI to the next level
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Data juice
Data juiceData juice
Data juice
 
Data Science Overview
Data Science OverviewData Science Overview
Data Science Overview
 
Delayed durability
Delayed durabilityDelayed durability
Delayed durability
 
Hekaton: In-memory tables
Hekaton: In-memory tablesHekaton: In-memory tables
Hekaton: In-memory tables
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql server
 

Dernier

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 

Dernier (20)

BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 

SQL Server 2016 JSON

  • 1. SQL Server 2016 JSON Davide Mauri Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 2. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek About Me Microsoft SQL Server MVP Works with SQL Server from 6.5, on BI from 2003 Specialized in Data Solution Architecture, Database Design, Performance Tuning, High-Performance Data Warehousing, BI, Big Data President of UGISS (Italian SQL Server UG) Regular Speaker @ SQL Server events Consulting & Training, Mentor @ SolidQ E-mail: dmauri@solidq.com Twitter: @mauridb Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
  • 3. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Agenda • JSON in life • JSON and SQL Server • JSON “Datatype” (not really) • Navigation via “dot” notation • LAX and STRICT path modes • JSON Functions • JSON_VALUE, JSON_QUERY, JSON_MODIFY, ISJSON • JSON & SQL • OPENJSON • FOR JSON • Indexes • The Dynamic Schema problem (or “the Relational Division”)
  • 4. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON in Life • That’s a DEV conference…. • …so I’m sure you know JSON pretty well  • For who doesn’t already know it: • JavaScript Object Notation • Simple, Human-Readable, Text data format • Based on Key-Value pair idea • Values can be: Scalar, Arrays, Key-Value pairs • No strict schema (yet) • Supported in any language, cross platform • De-facto standard • http://www.ietf.org/rfc/rfc4627.txt Image taken from wikipedia
  • 5. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON and SQL Server • No support until SQL Server2016 • Before SQL Server 2016: • One option is to use SQLCLR • Solutions available surfing the web: • http://www.sqlservercentral.com/articles/SQLCLR/74160/ • http://www.json4sql.com/examples.html • Another (more limited) option is a pure T-SQL solution • https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql- server/
  • 6. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON and SQL Server • Why native JSON support it’s important? • Simplify application development • Especially in non-MS environments, since JSON is *very* well supported (eg. Python / JS) • Reduces the impedance mismatch between app and db • Make schema extensibility a breeze • But without having *only* “liquid” schemas. Schema is a good thing in general. Having the option to decide when and when not use it is a key feature today:
  • 7. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON and SQL Server 2016 • Native support to JSON • No specific datatype format (like XML) • relies on varchar(max) • Specific function to • manipulate and create JSON • extract data from JSON • turn relational data into JSON and vice-versa
  • 8. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON Path • The dollar sign ($) represents the context item. • The property path is a set of path steps. • Key names. • Array elements. Arrays are zero-based. • The dot operator (.) indicates a member of an object. • “LAX” or “STRICT” option set invalid path handling • LAX: null • STRICT: error $.conference.speaker $.conference.speaker.editions[0]
  • 9. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON Path • Like XPATH but for JSON • http://goessner.net/articles/JsonPath • https://jsonpath.curiousconcept.com • http://jsonpath.com • SQL Server 2016 doesn’t offer a full support yet. • Is a subset of JSONPath
  • 10. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON Functions • Scalar functions to manage JSON data • ISJSON: test if string is JSON • JSON_VALUE: extract a scalar value • JSON_QUERY: extract a JSON value • JSON_MODIFY: modify a JSON property
  • 11. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO SQL/JSON First Contacts
  • 12. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON Functions • Tabular functions • OPENJSON: turn a JSON object into a table • FOR JSON: turn a table into a JSON object
  • 13. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek OPENJSON • Support both implicit and explicit schema: Type Meaning 0 null 1 string 2 int 3 true/false 4 array 5 object
  • 14. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek OPENJSON • Very useful with OPENROWSET to import JSON
  • 15. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek FOR JSON • Two modes: AUTO, PATH • AUTO: shape of JSON using the SELECT statement as guideline • PATH: column alias and JSON_QUERY function allows for total control of final JSON
  • 16. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO JSON and Relations
  • 17. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek JSON Indexes • JSON data support indexes…even if it doesn’t seems so! • Right, there is no special index like it happens with XML • How to index JSON Data • Create calculated columns for scalar JSON values you know if want to index • Create FULLTEXT index to index whole JSON document • Use the FULLTEXT index to perform “near” term search • CONTAINS(JSON_DATA, ‘NEAR((“Key”, “Value”),1)’) • Uses a “Generalized Inverted Index” (like Postgres) • https://msdn.microsoft.com/en-us/library/cc879306.aspx • Indexes to support JSON Path queries (like XML) are not yet there • You have to DIY here (Service Broker to async update EAV table)
  • 18. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO JSON Indexing
  • 19. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Dynamic Schema • JSON sounds like a perfect solution of all the “Dynamic Schema” situations • Why “Dynamic Schema” and not Schemaless? • Because schemaless does not *really* exists! In reality a schema always exists, albeit implicit, otherwise it would be impossible to handle data
  • 20. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Implict Schema Any data that doesn't fit this implicit schema will not be manipulated properly, leading to errors. (Schemaless data structures, Martin Fowler)
  • 21. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Words of Wisdom «Schemaless => implicit schema = bad. Prefer an explicit schema» (Schemaless data structures, Martin Fowler)
  • 22. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Dynamic Schema • What if my use case is one that perfectly fits the need for a implicit schema? • The only possible solution are the so-called «No-SQL» databases • Document Database or Key-Value store? • How can I integrate it into already existing database? • Integration does not come for free! • Now with SQL Server 2016 we have an additional option!  • No integration problems, No added complexity • Great Performances • Works within a well-known platform
  • 23. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Dynamic Schema
  • 24. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Last things • JSON and the new COMPRESS function works well together: • Compress using GZIP algorithm (Natively supported by browsers) • Simplify app development and integration with rdbms • Sample usage with node.js • http://www.codeproject.com/Articles/1063475/Pushing-Compression-from- node-js-to-SQL-Server • JSON is also supported on SQL Azure • Requires server version V12
  • 25. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Conclusions • JSON does not substitute relational solutions • Can be useful to extend them • Can be *very* useful to simplify app-to-db communications • JSON as parameter value! That’s a dream  • FAQ: • https://msdn.microsoft.com/en-us/library/mt631706.aspx • Follow SQL Server JSON PM: • https://blogs.msdn.microsoft.com/sqlserverstorageengine/tag/json
  • 26. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Help us to make JSON support better! • Don't restrict JSON_VALUE and JSON_QUERY to string literals only for the path • https://connect.microsoft.com/SQLServer/Feedback/Details/2235470 • Support JSON in COLUMNSET for SPARSE columns • https://connect.microsoft.com/SQLServer/feedback/details/2533991
  • 27. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Help us to make JSON support better! • Allow support for JSON of simple arrays generation • https://connect.microsoft.com/SQLServer/Feedback/Details/1383569 • JSON_VALUE: adding another optional parameter, which defines what type of value the function will return • https://connect.microsoft.com/SQLServer/Feedback/Details/2543881
  • 28. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Thanks! Questions?
  • 29. Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Demos available on GitHub https://github.com/yorek/devweek2016