SlideShare a Scribd company logo
DBAs vs Developers:
JSON in SQL Server
| Bert Wagner | September 30, 2017
1
DBAs vs Developers: JSON in SQL Server
Background
• BI developer @ Progressive Insurance for 6+ years
• I ❤ JSON – I use it in APIs, hardware projects, websites
• I also ❤ SQL – relational database structures
3
Overview
• What is JSON?
• Why use JSON?
• When is it appropriate to store JSON in SQL?
• Usage examples:
• ETL and reporting
• Database object maintenance
• Performance parsing
• Performance comparisons
4
5
What does JSON look like?
{
“Make” : “Volkswagen”,
“Year” : 2003,
“Model” : {
“Base” : “Golf”,
“Trim” : “GL”
},
“Colors” : [“White”, “Pearl”, “Rust”],
“PurchaseDate” : “2006-10-05T00:00:00.000Z”
}
6
Why use JSON?
Easy Processing
var car = { "Make" : "Volkswagen" };
console.log(car.Make);
// Output: Volkswagen
car.Year = 2003;
console.log(car);
// Output: { "Make" : "Volkswagen", "Year" : 2003" }
Javascript:
7
Why use JSON?
APIs
8
Why use JSON?
Storage Size
<Car>
<Make>Volkswagen</Make>
<Year>2003</Year>
<Model>
<Base>Golf</Base>
<Trim>GL</Trim>
</Model>
<Colors>
<Color>White</Color>
<Color>Pearl</Color>
<Color>Rust</Color>
</Colors>
<PurchaseDate>
2006-10-05 00:00:00.000
</PurcaseDate>
</Car>
{
“Make” : “Volkswagen”,
“Year” : 2003,
“Model” : {
“Base” : “Golf”,
“Trim” : “GL”
},
“Colors” :
[“White”, “Pearl”, Rust”],
“PurchaseDate” :
“2006-10-05T00:00:00.000Z”
}
XML: 225 Characters JSON: 145 Characters
9
Appropriate Usage
Staging Data
• Load data raw
• Validate
• Transform
10
Appropriate Usage
Error Logging
ErrorDate Component Data
2016-03-17 21:23:39 GetInventory { "Make : "Volkswagen", "Year" : 2003}
2016-03-19 12:59:31 Login { "User" : "Bert", "Referrer" : "http://google.com",
"AdditionalDetails" : "Invalid number of login attempts" }
11
Appropriate Usage
Non-Analytical Data
• Sessions
• User preferences
• Non-frequently changing variables
• Admin emails
• Static dropdown menus
12
Inappropriate Usage
High-Performance Requirements
13
Inappropriate Usage
Validation/Integrity Requirements
14
Inappropriate Usage
Being Lazy
Demos
1. ETL and reporting
2. Database object maintenance
3. Performance parsing w/ computed column indexes
4. SQL JSON vs XML vs .NET performance comparisons
15
Performance Results - XML
16
• JSON faster in almost all categories
• If considering entire app performance, maybe faster in
all categories
Performance Results - .NET
17
• Competitive with C# libraries
• Indexes on computed columns are BLAZING!
18
JSON – What’s new in SQL Server 2017?
• Clustered column store indexes support nvarchar(max)
• Compression
• Faster (maybe)
• In memory-optimized tables
• Computed columns
• All JSON functions supported
Recap
19
• Many good (and bad) uses for JSON in SQL exist
• JSON can be fully manipulated in SQL Server 2016
• JSON is preferable to XML for new projects
• JSON performance is comparable to .NET, faster with
computed column indexes
Thank you!
Twitter: @bertwagner
Blog: https://bertwagner.com <- new post every Tuesday
Vlog: https://bertwagner.com <- new video every Tuesday
Email: bert@bertwagner.com
20
21
Appendix
Software for keeping screen region on top
• On Top Replica
Blog posts and YouTube videos:
• SQL Server JSON Usage - Parsing
• SQL Server JSON Usage - Creating
• SQL Server JSON Usage - Updating, Adding, Deleting
• Performance Comparisons - .NET
• Performance Comparisons - XML
• Performance Comparisons - .NET and XML Redux
• JSON Computed Column Indexes
• Jovan Popovic’s JSON posts
Microsoft Connect
• Add an option to JSON_MODIFY() to fully delete values from arrays

More Related Content

What's hot (19)

PDF
饿了么工作流介绍
Zhongke Chen
 
PDF
MongoDB vs OrientDB
Stefano Campese
 
PPTX
Building solutions with the SharePoint Framework - introduction
Waldek Mastykarz
 
PPTX
NoSQL Database in .NET Apps
Shiju Varghese
 
PPS
WEBridge 4 SAP R 1.0
Gandhavalla Informatics Pvt Ltd.
 
PPTX
Introduction presentation
Vladislav Hadzhiyski
 
PPTX
Mvc razor and working with data
Vladislav Hadzhiyski
 
PPTX
Web forms Overview Presentation
Vladislav Hadzhiyski
 
PPTX
Exciting Features for SQL Devs in SQL 2012
Brij Mishra
 
PDF
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
Trivadis
 
PDF
The XML Forms Architecture
iText Group nv
 
PDF
Visualize your graph database
Michael Hackstein
 
PDF
Building Read Models using event streams
Denis Ivanov
 
PPTX
ASP.NET MVC overview
Vladislav Hadzhiyski
 
PDF
The journey of Moving from AWS ELK to GCP Data Pipeline
Randy Huang
 
PDF
Static is just a cache
Vsevolod Zaikov
 
PDF
Async streams
Christian Nagel
 
PDF
WHYs and HOWs of Power Query to Power BI
Islam Sylvia
 
PPTX
Grokking TechTalk #16: Html js and three way binding
Grokking VN
 
饿了么工作流介绍
Zhongke Chen
 
MongoDB vs OrientDB
Stefano Campese
 
Building solutions with the SharePoint Framework - introduction
Waldek Mastykarz
 
NoSQL Database in .NET Apps
Shiju Varghese
 
WEBridge 4 SAP R 1.0
Gandhavalla Informatics Pvt Ltd.
 
Introduction presentation
Vladislav Hadzhiyski
 
Mvc razor and working with data
Vladislav Hadzhiyski
 
Web forms Overview Presentation
Vladislav Hadzhiyski
 
Exciting Features for SQL Devs in SQL 2012
Brij Mishra
 
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
Trivadis
 
The XML Forms Architecture
iText Group nv
 
Visualize your graph database
Michael Hackstein
 
Building Read Models using event streams
Denis Ivanov
 
ASP.NET MVC overview
Vladislav Hadzhiyski
 
The journey of Moving from AWS ELK to GCP Data Pipeline
Randy Huang
 
Static is just a cache
Vsevolod Zaikov
 
Async streams
Christian Nagel
 
WHYs and HOWs of Power Query to Power BI
Islam Sylvia
 
Grokking TechTalk #16: Html js and three way binding
Grokking VN
 

Similar to DBAs vs Developers: JSON in SQL Server (20)

PPTX
JSON in SQL Server 2016
Bert Wagner
 
PPTX
Demystifying JSON in SQL Server
kristinferrier
 
PDF
Native JSON Support in SQL2016
Ivo Andreev
 
PPTX
Sql Server 2016 and JSON
Greg McMurray
 
PPTX
JSON as a SQL Datatype
Robert Sell
 
PPTX
Azure SQL & SQL Server 2016 JSON
Davide Mauri
 
PPTX
SQL Server 2016 JSON
Davide Mauri
 
PDF
JSON Support in DB2 for z/OS
Jane Man
 
PPTX
The rise of json in rdbms land jab17
alikonweb
 
PPTX
[Eng] Sql Saturday TorinoExpo - Sql Server 2016 JSON support
Alessandro Alpi
 
PPTX
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
PPTX
MySQL Rises with JSON Support
Okcan Yasin Saygılı
 
PDF
How to Use JSON in MySQL Wrong
Karwin Software Solutions LLC
 
PPT
The NoSQL Way in Postgres
EDB
 
PDF
Hybrid Databases - PHP UK Conference 22 February 2019
Dave Stokes
 
PDF
Using JSON with MariaDB and MySQL
Anders Karlsson
 
PDF
Json in Postgres - the Roadmap
EDB
 
PDF
Json improvements in my sql 8.0
Mysql User Camp
 
PPT
Do More with Postgres- NoSQL Applications for the Enterprise
EDB
 
PPTX
Compare SQL changes|SQL Database Modeler
SQL DBM
 
JSON in SQL Server 2016
Bert Wagner
 
Demystifying JSON in SQL Server
kristinferrier
 
Native JSON Support in SQL2016
Ivo Andreev
 
Sql Server 2016 and JSON
Greg McMurray
 
JSON as a SQL Datatype
Robert Sell
 
Azure SQL & SQL Server 2016 JSON
Davide Mauri
 
SQL Server 2016 JSON
Davide Mauri
 
JSON Support in DB2 for z/OS
Jane Man
 
The rise of json in rdbms land jab17
alikonweb
 
[Eng] Sql Saturday TorinoExpo - Sql Server 2016 JSON support
Alessandro Alpi
 
BGOUG15: JSON support in MySQL 5.7
Georgi Kodinov
 
MySQL Rises with JSON Support
Okcan Yasin Saygılı
 
How to Use JSON in MySQL Wrong
Karwin Software Solutions LLC
 
The NoSQL Way in Postgres
EDB
 
Hybrid Databases - PHP UK Conference 22 February 2019
Dave Stokes
 
Using JSON with MariaDB and MySQL
Anders Karlsson
 
Json in Postgres - the Roadmap
EDB
 
Json improvements in my sql 8.0
Mysql User Camp
 
Do More with Postgres- NoSQL Applications for the Enterprise
EDB
 
Compare SQL changes|SQL Database Modeler
SQL DBM
 
Ad

Recently uploaded (20)

PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Ad

DBAs vs Developers: JSON in SQL Server

  • 1. DBAs vs Developers: JSON in SQL Server | Bert Wagner | September 30, 2017 1
  • 3. Background • BI developer @ Progressive Insurance for 6+ years • I ❤ JSON – I use it in APIs, hardware projects, websites • I also ❤ SQL – relational database structures 3
  • 4. Overview • What is JSON? • Why use JSON? • When is it appropriate to store JSON in SQL? • Usage examples: • ETL and reporting • Database object maintenance • Performance parsing • Performance comparisons 4
  • 5. 5 What does JSON look like? { “Make” : “Volkswagen”, “Year” : 2003, “Model” : { “Base” : “Golf”, “Trim” : “GL” }, “Colors” : [“White”, “Pearl”, “Rust”], “PurchaseDate” : “2006-10-05T00:00:00.000Z” }
  • 6. 6 Why use JSON? Easy Processing var car = { "Make" : "Volkswagen" }; console.log(car.Make); // Output: Volkswagen car.Year = 2003; console.log(car); // Output: { "Make" : "Volkswagen", "Year" : 2003" } Javascript:
  • 8. 8 Why use JSON? Storage Size <Car> <Make>Volkswagen</Make> <Year>2003</Year> <Model> <Base>Golf</Base> <Trim>GL</Trim> </Model> <Colors> <Color>White</Color> <Color>Pearl</Color> <Color>Rust</Color> </Colors> <PurchaseDate> 2006-10-05 00:00:00.000 </PurcaseDate> </Car> { “Make” : “Volkswagen”, “Year” : 2003, “Model” : { “Base” : “Golf”, “Trim” : “GL” }, “Colors” : [“White”, “Pearl”, Rust”], “PurchaseDate” : “2006-10-05T00:00:00.000Z” } XML: 225 Characters JSON: 145 Characters
  • 9. 9 Appropriate Usage Staging Data • Load data raw • Validate • Transform
  • 10. 10 Appropriate Usage Error Logging ErrorDate Component Data 2016-03-17 21:23:39 GetInventory { "Make : "Volkswagen", "Year" : 2003} 2016-03-19 12:59:31 Login { "User" : "Bert", "Referrer" : "http://google.com", "AdditionalDetails" : "Invalid number of login attempts" }
  • 11. 11 Appropriate Usage Non-Analytical Data • Sessions • User preferences • Non-frequently changing variables • Admin emails • Static dropdown menus
  • 15. Demos 1. ETL and reporting 2. Database object maintenance 3. Performance parsing w/ computed column indexes 4. SQL JSON vs XML vs .NET performance comparisons 15
  • 16. Performance Results - XML 16 • JSON faster in almost all categories • If considering entire app performance, maybe faster in all categories
  • 17. Performance Results - .NET 17 • Competitive with C# libraries • Indexes on computed columns are BLAZING!
  • 18. 18 JSON – What’s new in SQL Server 2017? • Clustered column store indexes support nvarchar(max) • Compression • Faster (maybe) • In memory-optimized tables • Computed columns • All JSON functions supported
  • 19. Recap 19 • Many good (and bad) uses for JSON in SQL exist • JSON can be fully manipulated in SQL Server 2016 • JSON is preferable to XML for new projects • JSON performance is comparable to .NET, faster with computed column indexes
  • 20. Thank you! Twitter: @bertwagner Blog: https://bertwagner.com <- new post every Tuesday Vlog: https://bertwagner.com <- new video every Tuesday Email: [email protected] 20
  • 21. 21 Appendix Software for keeping screen region on top • On Top Replica Blog posts and YouTube videos: • SQL Server JSON Usage - Parsing • SQL Server JSON Usage - Creating • SQL Server JSON Usage - Updating, Adding, Deleting • Performance Comparisons - .NET • Performance Comparisons - XML • Performance Comparisons - .NET and XML Redux • JSON Computed Column Indexes • Jovan Popovic’s JSON posts Microsoft Connect • Add an option to JSON_MODIFY() to fully delete values from arrays

Editor's Notes

  • #6: What is JSON, where it used, why is it used