SlideShare a Scribd company logo
DBAs vs Developers:
JSON in SQL Server
| Bert Wagner | March 8, 2018
1
DBAs vs Developers: JSON in SQL Server - CBusPASS
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
Demo code and slides available at bertwagner.com
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!
@bertwagner
bertwagner.com
youtube.com/c/bertwagner
bert@bertwagner.com
20
New posts and
videos every
Tuesday!
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 (20)

PPTX
Exciting Features for SQL Devs in SQL 2012
Brij Mishra
 
PDF
London React August - GraphQL at The Financial Times - Viktor Charypar
React London Community
 
PPTX
Angular JS and Magento
Vinci Rufus
 
PDF
Developing webapp using Polymer : is it ready for production? or not?
Jeongkyu Shin
 
PDF
GraphQL & Relay
Viacheslav Slinko
 
PPTX
Asp.net web forms new shiny things part 1
Lohith Goudagere Nagaraj
 
PDF
mabl's Machine Learning Implementation on Google Cloud Platform
Joseph Lust
 
PPTX
Introduction to GraphQL - RVA JavaScript 2019
Matt Lavin
 
PDF
APEX Office Print
Dimitri Gielis
 
PPTX
NoSQL Database in .NET Apps
Shiju Varghese
 
PPT
Big Data DC - BenchPress
Drew Stephens
 
PDF
Automated Bulk Conversion of 250,000+ CAD and Corresponding Raster Files to PDF
Safe Software
 
PPSX
Released WEBridge 4 SAP R 3 on 9/9 of 2014
Gandhavalla Informatics Pvt Ltd.
 
PDF
Translation
PhilWinstanley
 
PDF
Reporting with Oracle Application Express (APEX)
Dimitri Gielis
 
PDF
GraphQL
Cédric GILLET
 
PDF
Flink Forward San Francisco 2018: Ken Krugler - "Building a scalable focused ...
Flink Forward
 
PDF
FeedHenry & MongoDB
Cian Clarke
 
PDF
GraphQL With Relay Part Deux
Brad Pillow
 
PDF
C# 8 and .NET Core 3
Christian Nagel
 
Exciting Features for SQL Devs in SQL 2012
Brij Mishra
 
London React August - GraphQL at The Financial Times - Viktor Charypar
React London Community
 
Angular JS and Magento
Vinci Rufus
 
Developing webapp using Polymer : is it ready for production? or not?
Jeongkyu Shin
 
GraphQL & Relay
Viacheslav Slinko
 
Asp.net web forms new shiny things part 1
Lohith Goudagere Nagaraj
 
mabl's Machine Learning Implementation on Google Cloud Platform
Joseph Lust
 
Introduction to GraphQL - RVA JavaScript 2019
Matt Lavin
 
APEX Office Print
Dimitri Gielis
 
NoSQL Database in .NET Apps
Shiju Varghese
 
Big Data DC - BenchPress
Drew Stephens
 
Automated Bulk Conversion of 250,000+ CAD and Corresponding Raster Files to PDF
Safe Software
 
Released WEBridge 4 SAP R 3 on 9/9 of 2014
Gandhavalla Informatics Pvt Ltd.
 
Translation
PhilWinstanley
 
Reporting with Oracle Application Express (APEX)
Dimitri Gielis
 
Flink Forward San Francisco 2018: Ken Krugler - "Building a scalable focused ...
Flink Forward
 
FeedHenry & MongoDB
Cian Clarke
 
GraphQL With Relay Part Deux
Brad Pillow
 
C# 8 and .NET Core 3
Christian Nagel
 

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

PDF
NoSQL on ACID - Meet Unstructured Postgres
EDB
 
PPTX
What is Mean Stack Development ?
Balajihope
 
PPTX
How SQL Server 2016 SP1 Changes the Game
PARIKSHIT SAVJANI
 
PPTX
Mean stack
RavikantGautam8
 
PPTX
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Joshua Miller
 
PDF
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
PDF
Using BigDL on Apache Spark to Improve the MLS Real Estate Search Experience ...
Databricks
 
PDF
ArangoDB – A different approach to NoSQL
ArangoDB Database
 
PDF
MEAN Stack
Krishnaprasad k
 
PDF
MEAN Stack
Krishnaprasad k
 
PDF
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Arun Gupta
 
PPTX
Custom Development for SharePoint
Talbott Crowell
 
PDF
ArangoDB
ArangoDB Database
 
PDF
Node.js and couchbase Full Stack JSON - Munich NoSQL
Philipp Fehre
 
PDF
Meanstack Introduction by Kishore Chandra
Kishore Chandra
 
PPTX
FULL stack -> MEAN stack
Ashok Raj
 
DOC
Ken_Wu_Resume_2017N
Ken Wu
 
DOC
Ken_Wu_Resume_2017N
Ken Wu
 
PPTX
mearn-stackjdksjdsfjdkofkdokodkojdj.pptx
aravym456
 
PPTX
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
iCiDIGITAL
 
NoSQL on ACID - Meet Unstructured Postgres
EDB
 
What is Mean Stack Development ?
Balajihope
 
How SQL Server 2016 SP1 Changes the Game
PARIKSHIT SAVJANI
 
Mean stack
RavikantGautam8
 
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Joshua Miller
 
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Using BigDL on Apache Spark to Improve the MLS Real Estate Search Experience ...
Databricks
 
ArangoDB – A different approach to NoSQL
ArangoDB Database
 
MEAN Stack
Krishnaprasad k
 
MEAN Stack
Krishnaprasad k
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Arun Gupta
 
Custom Development for SharePoint
Talbott Crowell
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Philipp Fehre
 
Meanstack Introduction by Kishore Chandra
Kishore Chandra
 
FULL stack -> MEAN stack
Ashok Raj
 
Ken_Wu_Resume_2017N
Ken Wu
 
Ken_Wu_Resume_2017N
Ken Wu
 
mearn-stackjdksjdsfjdkofkdokodkojdj.pptx
aravym456
 
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
iCiDIGITAL
 
Ad

Recently uploaded (20)

PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Ad

DBAs vs Developers: JSON in SQL Server - CBusPASS

  • 1. DBAs vs Developers: JSON in SQL Server | Bert Wagner | March 8, 2018 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 Demo code and slides available at bertwagner.com
  • 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
  • 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