SlideShare a Scribd company logo
JSON Usage and
Performance in
SQL Server 2016
NEO SQL Server User Group | Bert Wagner | April 4, 2017
1
Json usage and performance in sql server 2016
Background
● BI developer at Progressive Insurance for 6+ years
● I love JSON - I use it in APIs, hardware projects, websites
● I also love SQL and relational database structures
● Slide, demos, code is available on bertwagner.com
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
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
15
Performance Results
16
● Indexes on computed columns are the solution
● Faster than C# libraries in some cases
Recap
17
● Many good (and bad) uses for JSON in SQL exist
● JSON can be fully manipulated in SQL Server 2016
● Performance is fast, especially with computed
column indexes
Thank you!
● Twitter: @bertwagner
● Blog: https://bertwagner.com
● Email: bertwagner@bertwagner.com
18

More Related Content

PPTX
DBAs vs Developers: JSON in SQL Server
PPTX
JSON in SQL Server 2016
PDF
High Performance SSRS
PPTX
DBAs vs Developers - JSON in SQL Server
PPTX
DBAs vs Developers: JSON in SQL Server - CBusPASS
PDF
WEBridge 4 SAP ( Windchill and SAP Integration)
PDF
WEBridge 4 EBS ( Windchill and Oracle EBS Integration )
PDF
饿了么工作流介绍
DBAs vs Developers: JSON in SQL Server
JSON in SQL Server 2016
High Performance SSRS
DBAs vs Developers - JSON in SQL Server
DBAs vs Developers: JSON in SQL Server - CBusPASS
WEBridge 4 SAP ( Windchill and SAP Integration)
WEBridge 4 EBS ( Windchill and Oracle EBS Integration )
饿了么工作流介绍

What's hot (18)

PPS
WEBridge 4 SAP R 1.0
PPTX
NoSQL Database in .NET Apps
PDF
FME the Workhorse of the Enterprise System
PPTX
Exciting Features for SQL Devs in SQL 2012
PDF
Developing webapp using Polymer : is it ready for production? or not?
PPTX
Enterprise Reporting: Couchbase N1QL, ODBC and JDBC
PDF
GitLab Product Update Oct 3
PDF
GraphQL & Relay
PDF
Can You Do That with APEX? Building Not So Straightforward Pages
PDF
SBT Made Simple
PDF
AEM/CQ Montreal User Group Meeting - March 25, 2015 - Takeaways from Adobe Su...
PDF
No sql db comparison
PDF
Rencore Webinar: Developing Secure and Performant JavaScript for SharePoint
PDF
Arrested by the cap devoxx uk 2018
PDF
Web fonts FTW
PDF
Domain Driven Design Up And Running
PDF
Mongo and ElasticSearch
PPTX
MongoDB at Flight Centre Ltd
WEBridge 4 SAP R 1.0
NoSQL Database in .NET Apps
FME the Workhorse of the Enterprise System
Exciting Features for SQL Devs in SQL 2012
Developing webapp using Polymer : is it ready for production? or not?
Enterprise Reporting: Couchbase N1QL, ODBC and JDBC
GitLab Product Update Oct 3
GraphQL & Relay
Can You Do That with APEX? Building Not So Straightforward Pages
SBT Made Simple
AEM/CQ Montreal User Group Meeting - March 25, 2015 - Takeaways from Adobe Su...
No sql db comparison
Rencore Webinar: Developing Secure and Performant JavaScript for SharePoint
Arrested by the cap devoxx uk 2018
Web fonts FTW
Domain Driven Design Up And Running
Mongo and ElasticSearch
MongoDB at Flight Centre Ltd
Ad

Similar to Json usage and performance in sql server 2016 (20)

PDF
Advanced Swift programming-Read and Write JSON.pdf
PDF
Linked Data voor developers - PiLOD congres 25 juni
PPTX
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
PDF
MySQL 8.0 Optimizer Guide
PPTX
Custom Development for SharePoint
PDF
Building an E-commerce website in MEAN stack
KEY
Mongo Seattle - The Business of MongoDB
PDF
Presto: Query Anything - Data Engineer’s perspective
PDF
Webinar: Schema Patterns and Your Storage Engine
PPTX
How to Handle DEV&TEST&PROD for Oracle Data Integrator
PPTX
MongoDB Schema Design
PDF
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
DOCX
Kenneth yucha it_resume
PPTX
Content migration for sitecore
PDF
NoSQL on ACID - Meet Unstructured Postgres
 
PPTX
Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
PPTX
Angular Unleashed : Mastering the Beast of Web Development.pptx
PPTX
Graph Analytics on Data from Meetup.com
PDF
Areeb CV
PPTX
Practical Business Intelligence in SharePoint 2013 - Honolulu
Advanced Swift programming-Read and Write JSON.pdf
Linked Data voor developers - PiLOD congres 25 juni
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MySQL 8.0 Optimizer Guide
Custom Development for SharePoint
Building an E-commerce website in MEAN stack
Mongo Seattle - The Business of MongoDB
Presto: Query Anything - Data Engineer’s perspective
Webinar: Schema Patterns and Your Storage Engine
How to Handle DEV&TEST&PROD for Oracle Data Integrator
MongoDB Schema Design
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Kenneth yucha it_resume
Content migration for sitecore
NoSQL on ACID - Meet Unstructured Postgres
 
Practical Business Intelligence in SharePoint 2013 - Helsinki Finalnd
Angular Unleashed : Mastering the Beast of Web Development.pptx
Graph Analytics on Data from Meetup.com
Areeb CV
Practical Business Intelligence in SharePoint 2013 - Honolulu
Ad

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Network Security Unit 5.pdf for BCA BBA.

Json usage and performance in sql server 2016

  • 1. JSON Usage and Performance in SQL Server 2016 NEO SQL Server User Group | Bert Wagner | April 4, 2017 1
  • 3. Background ● BI developer at Progressive Insurance for 6+ years ● I love JSON - I use it in APIs, hardware projects, websites ● I also love SQL and relational database structures ● Slide, demos, code is available on bertwagner.com 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 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 15
  • 16. Performance Results 16 ● Indexes on computed columns are the solution ● Faster than C# libraries in some cases
  • 17. Recap 17 ● Many good (and bad) uses for JSON in SQL exist ● JSON can be fully manipulated in SQL Server 2016 ● Performance is fast, especially with computed column indexes
  • 18. Thank you! ● Twitter: @bertwagner ● Blog: https://bertwagner.com ● Email: bertwagner@bertwagner.com 18

Editor's Notes

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