Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
us/data/hh237663.aspx
https://msdn.microsoft.com/en-
http://www.json.org/xml.html or
http://xmlsucks.blogspot.com/
https://msdn.microsoft.com/enus/library/bb299886.aspx
http://jsonlint.com/
https://twitter.com/search?q=hfhtml5
http://www.jqchart.com/jquery/geomap/Data/EarthQuakes
https://blogs.msdn.microsoft.com/sqlserverstorageengine/2015/10
/02/parsing-geojson-format-in-sql-server-2016/
JSON C# Libraries
Parsing JSON Files “Deserialize” OR Generating JSON Files “Serialize”
• JavaScriptSerializer .NET Class
• JSON.NET Library (available on NUGET)
• Check https://mva.microsoft.com/en-US/training-courses/introduction-to-json-with-c12742
JSON integration
•
Primer on JSON
•
JSON in HTML5 & JavaScript
•
JSON in C# - parsing & storing JSON
•
JSON in DocumentDB
•
SQL Server 2016 and JSON
Not only SQL vs SQL overview
Non-relational (NoSQL)
Relational (SQL)
Microsoft Analytics Platform System
Analytical
SQL Server Database Engine
Azure SQL Database
Azure managed data service
Operational
SQL and NoSQL
fully featured RDBMS
rich query
transactional processing
managed as a service
elastic scale
schema-free data model
internet accessible http/rest
arbitrary data formats
DocumentDB overview
A NoSQL document database-as-a-service, fully managed by Microsoft Azure.
For cloud-designed apps when query over schema-free data; reliable and predictable performance; and rapid development are key.
First of its kind database service to offer native support for JavaScript, SQL query and transactions over JSON documents.
Perfect for cloud architects and developers who need an enterprise-ready NoSQL document database.
Query JSON data with no secondary indices
Fast, predictable performance
Native JavaScript transactional processing
Tunable consistency
Familiar SQL-based query language
Elastic scale
Build with familiar tools – REST, JSON,
JavaScript
Easy to start and fully-managed
Enterprise-grade Azure platform
DocumentDB at Microsoft
over 425 million unique users
user data store
store 20TB of JSON document data
available globally to serve all markets
store for 40+ app / device combinations
under 15ms writes and single digit ms reads
The basics
DocumentDB account
Databases
{ }
Collections
Documents
Attachments
101
010
{ }
Entities addressable by logical URI
Partitioned for scale out
Replicated for high availability
Users
Stored procedures
JS
Permissions
Resource model
Triggers
JS
your
Documents here
Entities represented as JSON
Accounts scale out through addition of capacity
units
Interaction model
RESTful interaction over HTTP
User-defined functions
JS
HTTP and TCP connectivity
Standard HTTP verbs and semantics
Development
.Net, Node, Python, Java and JavaScript clients
SQL for query expression, .Net LINQ
JavaScript for server-side app logic
DocumentDB
DocumentDB
A document store
Collections
Document 1
Document 2
{
{
"name": "John",
"country": "Canada",
"age": 43,
"lastUse": "March 4, 2014"
"name": "Eva",
"country": "Germany",
"age": 25
}
}
Application
Document 3
JSON
{
"name": "Lou",
"country": "Australia",
"age": 51,
"firstUse": "May 8, 2013"
}
Document 4
{
"docCount": 3,
"last": "May 1, 2014"
}
Storage?
SQL Server is not a specialized document store! DocumentDB is!
Handling variety
of data and
model changes
Information are
stored in JSON
format
Store and query
both relational
and JSON data
Pillars
Benefits
Drivers
Modern services
exchange data in
JSON format
Fast built-in
JSON/relational
data conversion
Combination of
relational and
JSON data
The power of
T-SQL and SQL
Server engine
Integration with
all SQL Server
components
Built-in functions
ISJSON
JSON_VALUE
JSON_MODIFY
[
{
},
{
]
}
"Number":"SO43659",
"Date":"2011-05-31T00:00:00"
"AccountNumber":"AW29825",
"Price":59.99,
"Quantity":1
"Number":"SO43661",
"Date":"2011-06-01T00:00:00“
"AccountNumber":"AW73565“,
"Price":24.99,
"Quantity":3
JSON 2 table
Transforms JSON
text to table
SO43659
2011-05-31T00:00:00
MSFT
59.99
1
SO43661
2011-06-01T00:00:00
Nokia
24.99
3
Table 2 JSON
Formats result set
as JSON text.
built-in functions
(Transact-SQL)
JSON_VALUE (Transact-SQL)
JSON_QUERY (Transact-SQL)
ISJSON
SELECT
*
FROM OPENJSON (@json)
WITH (
)
Number
Date
Customer
Quantity
varchar(200)
datetime
varchar(200)
int
N'$.Order.Number',
N'$.Order.Date',
N'$.Account',
N'$.Item.Quantity'
SO43659
2011-05-31T00:00:00
Microsoft
1
SO43661
2011-06-01T00:00:00
Nokia
3
SO43659
2011-05-31T00:00:00
MSFT
59.99
1
SO43661
2011-06-01T00:00:00
Nokia
24.99
3
SELECT
Number AS [Order.Number], Date AS [Order.Date],
Customer AS Account,
Price AS 'Item.UnitPrice', Quantity AS 'Item.Qty'
FROM SalesOrder
FOR JSON PATH
•
•
•
•
http://www.odata.org/documentation/odata-version-2-0/JSON-format/
http://codular.com/json
http://blogs.technet.com/b/dataplatforminsider/archive/2016/01/05/json-in-sql-server-2016-part-1-of-4.aspx
https://developer.mozilla.org/en/JSON
http://php.net/manual/en/book.json.php
http://jsonlint.com
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2015/09/01/combining-relational-and-nosql-concepts-in-sql-server-with-json.aspx
MSFT Virtual Academy:
https://mva.microsoft.com/en-US/training-courses/introduction-to-json-with-c-12742?l=xxtX274UB_8805494542
Javascript searilizer in .NET & Nuget package JSON.NET – 3rd party library
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2016/01/05/returning-spatial-data-in-geojson-format.aspx
http://blogs.msdn.com/b/sqlserverstorageengine/archive/tags/json/
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2015/09/01/combining-relational-and-nosql-concepts-in-sql-server-with-json.aspx
http://blogs.technet.com/b/dataplatforminsider/archive/2016/01/05/json-in-sql-server-2016-part-1-of-4.aspx
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2015/12/07/adventureworksctp3-json-sample.aspx
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2016/01/14/json-parsing-performance-comparison.aspx
https://msdn.microsoft.com/en-us/library/dn921897.aspx