SlideShare una empresa de Scribd logo
1 de 72
Querying NoSQL with SQL
HAVINGYour JSON Cake and SELECTing it too
Matthew D. Groves, @mgroves
TITANIUM SPONSORS
Platinum Sponsors
Gold Sponsors
©2017 Couchbase Inc. 3
Agenda
Why NoSQL?
JSON Data Modeling
SQL for JSON
Ecosystem and convergence
©2017 Couchbase Inc. 4
Where am I?
• KCDC (Kansas City Developer Conference)
• http://kcdc.info
©2017 Couchbase Inc. 5
Who am I?
• Matthew D. Groves
• DeveloperAdvocate for Couchbase
• @mgroves onTwitter
• Podcast and blog: http://crosscuttingconcerns.com
• “I am not an expert, but I am an enthusiast.”
– Alan Stevens
Querying NoSQL with SQL
HAVINGYour JSON Cake and
SELECTing it too
Matthew D. Groves, @mgroves
©2017 Couchbase Inc. 7
Major Enterprises Across Industries are Adopting NoSQL
CommunicationsTechnology
Travel & Hospitality Media &
Entertainment
E-Commerce &
DigitalAdvertising
Retail & Apparel
Games & GamingFinance &
Business Services
©2017 Couchbase Inc. 8
Why NoSQL?
©2017 Couchbase Inc. 9
NoSQL Landscape
Document
• Couchbase
• MongoDB
• DynamoDB
• DocumentDB
Graph
• OrientDB
• Neo4J
• DEX
• GraphBase
Key-Value
• Couchbase
• Riak
• BerkeleyDB
• Redis Wide Column
• Hbase
• Cassandra
• Hypertable
©2017 Couchbase Inc. 10
NoSQL Landscape
• Get by key(s)
• Set by key(s)
• Replace by key(s)
• Delete by key(s)
• Map/Reduce
Document
• Couchbase
• MongoDB
• DynamoDB
• DocumentDB
©2017 Couchbase Inc. 11
Why NoSQL? Scalability
©2017 Couchbase Inc. 12
Why NoSQL? Scalability
©2017 Couchbase Inc. 13
Why NoSQL? Flexibility
©2017 Couchbase Inc. 14
Why NoSQL? Performance
©2017 Couchbase Inc. 15
Why NoSQL? Availability
©2017 Couchbase Inc. 16
JSON Data Modeling
©2017 Couchbase Inc. 17
Models for Representing Data
Data Concern Relational Model JSON Document Model
Rich Structure
Relationships
Value Evolution
Structure
Evolution
©2017 Couchbase Inc. 18
Properties of Real-World Data
©2017 Couchbase Inc. 19
Modeling Data in RelationalWorld
Billing
ConnectionsPurchases
Contacts
Customer
CustomerID Name DOB
CBL2015 Jane Smith 1990-01-30
Table: Customer
{
"Name" : "Jane Smith",
"DOB" : "1990-01-30”
}
Customer DocumentKey: CBL2015
©2017 Couchbase Inc. 21
CustomerID Name DOB
CBL2015 Jane Smith 1990-01-30
Table: Customer {
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"Purchases" : [
{
"item" : "laptop",
"amount" : 1499.99,
"date" : "2019-03",
}
]
}
Customer DocumentKey: CBL2015
CustomerID Item Amount Date
CBL2015 laptop 1499.99 2019-03
Table: Purchases
CustomerID Name DOB
CBL2015 Jane Smith 1990-01-30
Table: Customer {
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"Purchases" : [
{
"item" : "laptop",
"amount" : 1499.99,
"date" : "2019-03",
},
{
"item" : "phone",
"amount" : 99.99,
"date" : "2018-12"
}
]
}
Customer DocumentKey: CBL2015
CustomerID Item Amount Date
CBL2015 laptop 1499.99 2019-03
CBL2015 phone 99.99 2018-12
Table: Purchases
CustomerID ConnId Name
CBL2015 XYZ987 Joe Smith
CBL2015 SKR007 Sam Smith
Table: Connections {
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"Billing" : [
{
"type" : "visa",
"cardnum" : "5827-2842-...",
"expiry" : "2019-03"
}, ...
],
"Connections" : [
{
"ConnId" : "XYZ987",
"Name" : "Joe Smith"
},
{
"ConnId" : ”SKR007",
"Name" : ”Sam Smith"
}
}
Customer DocumentKey: CBL2015
©2017 Couchbase Inc. 24
{
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"cardnum" : "5827-2842…",
"expiry" : "2019-03",
"cardType" : "visa",
"Connections" : [
{
"CustId" : "XYZ987",
"Name" : "Joe Smith"
},
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
],
"Purchases" : [
{ "id":12, item: "mac", "amt": 2823.52 }
{ "id":19, item: "ipad2", "amt": 623.52 }
]
}
DocumentKey: CBL2015
Custome
rID
Name DOB Cardnum Expiry CardType
CBL2015 Jane
Smith
1990-01-30 5827-
2842…
2019-03 visa
CustomerID ConnId Name
CBL2015 XYZ987 Joe Smith
CBL2015 SKR007 Sam Smith
CustomerID item amt
CBL2015 mac 2823.52
CBL2015 ipad2 623.52
CustomerID ConnId Name
CBL2015 XYZ987 Joe Smith
CBL2015 SKR007 Sam
Smith
Contacts
Customer
ConnectionsPurchases
{
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"Billing" : [
{
"type" : "visa",
"cardnum" : "5827-2842-2847-3909",
"expiry" : "2019-03"
},
{
"type" : "master",
"cardnum" : "6274-2842-2847-3909",
"expiry" : "2019-03"
}
],
"Connections" : [
{
"CustId" : "XYZ987",
"Name" : "Joe Smith"
},
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
],
"Purchases" : [
{ "id":12, item: "mac", "amt": 2823.52 }
{ "id":19, item: "ipad2", "amt": 623.52 }
]
}
DocumentKey: CBL2015
CustomerID Name DOB
CBL2015 Jane Smith 1990-01-30
Customer
ID
Type Cardnum Expiry
CBL2015 visa 5827… 2019-03
CBL2015 master 6274… 2018-12
CustomerID ConnId Name
CBL2015 XYZ987 Joe Smith
CBL2015 SKR007 Sam Smith
CustomerID item amt
CBL2015 mac 2823.52
CBL2015 ipad2 623.52
CustomerID ConnId Name
CBL2015 XYZ987 Joe Smith
CBL2015 SKR007 Sam
Smith
Contacts
Customer
Billing
ConnectionsPurchases
©2017 Couchbase Inc. 26
Models for Representing Data
Data Concern Relational Model
JSON Document Model
(NoSQL)
Rich Structure
 Multiple flat tables
 Constant assembly / disassembly
 Documents
 No assembly required!
Relationships
 Represented
 Queried (SQL)
 Represented
 Queried? Not until now…
Value Evolution  Data can be updated  Data can be updated
Structure Evolution
 Uniform and rigid
 Manual change (disruptive)
 Flexible
 Dynamic change
©2017 Couchbase Inc. 27
SQL for JSON
©2017 Couchbase Inc. 28
Why SQL for JSON?
©2017 Couchbase Inc. 29
Client Side Querying is Inadequate
Example: Find High-Value Customers with Orders > $10000
Query ‘customer’
objects from
database
For each ‘customer’
object
Find all the ‘order’
objects for the
‘customer’
Calculate the total
amount for each
‘order’
Sum up the grand
total amount for all
‘orders’
If grand total
amount > $10000,
Extract ‘customer’
data
Add ‘customer’ to
the high-value
customer list
Sort the high-value
customer list
©2017 Couchbase Inc. 30
Goal of Query for JSON
Give developers and enterprises an expressive,
powerful, and complete language for querying,
transforming, and manipulating JSON data.
©2017 Couchbase Inc. 31
©2017 Couchbase Inc. 32
route_5966 ← key
{
"type": "route", ← document type identifier
"airlineid": "airline_24", ← foreign key
"sourceairport": "MCO",
"destinationairport": "SEA",
"equipment": "737",
"schedule": [
{"day": 1, "utc": "13:25:00", "flight": "AA788"},
{"day": 4, "utc": "13:25:00", "flight": "AA419"},
{"day": 5, "utc": "13:25:00", "flight": "AA519"}
]
}
©2017 Couchbase Inc. 33
airline_24 ← key
{
"active": "Y",
"callsign": "AMERICAN",
"country": "United States",
"iata": "AA",
"icao": "AAL",
"name": "American Airlines",
"type": "airline" ← document type identifier
}
©2017 Couchbase Inc. 34
SELECT: JOIN
©2017 Couchbase Inc. 35
SELECT: Aggregation
©2017 Couchbase Inc. 36
SELECT: Aggregation
MIN
MAX
SUM
COUNT
AVG
ARRAY_AGG [ DISTINCT ]
©2017 Couchbase Inc. 37
SELECT: UNION, UNION ALL, INTERSECT, EXCEPT
©2017 Couchbase Inc. 38
USE KEYS
©2017 Couchbase Inc. 39
UNNEST (aka JOIN)
©2017 Couchbase Inc. 40
UNNEST (aka JOIN)
©2017 Couchbase Inc. 41
UNNEST (aka JOIN)
©2017 Couchbase Inc. 42
UNNEST (aka JOIN)
©2017 Couchbase Inc. 46
Composability
JOIN, NEST, and UNNEST
can be chained in any combination
©2017 Couchbase Inc. 47
SELECT Statement
SELECT customers.id,
customers.NAME.lastname,
customers.NAME.firstname
Sum(orderline.amount)
FROM `orders` UNNEST orders.lineitems AS orderline
JOIN `customers` ON KEYS orders.custid
WHERE customers.state = 'NY'
GROUP BY customers.id,
customers.NAME.lastname
HAVING sum(orderline.amount) > 10000
ORDER BY sum(orderline.amount) DESC
• Dotted sub-document reference
• Names are CASE-SENSITIVE
• UNNEST to flatten the arrays
JOINS with Document KEY of
customers
©2017 Couchbase Inc. 49
ResultSet
©2017 Couchbase Inc. 50
{
"Name" : "Jane Smith",
"DOB" : "1990-01-30",
"Billing" : [
{
"type" : "visa",
"cardnum" : "5827-2842-2847-3909",
"expiry" : "2019-03"
},
{
"type" : "master",
"cardnum" : "6274-2842-2847-3909",
"expiry" : "2019-03"
}
],
"Connections" : [
{
"CustId" : "XYZ987",
"Name" : "Joe Smith"
},
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
{
"CustId" : "PQR823",
"Name" : "Dylan Smith"
}
],
"Purchases" : [
{ "id":12, item: "mac", "amt": 2823.52 }
{ "id":19, item: "ipad2", "amt": 623.52 }
]
}
LoyaltyInfo ResultDocuments
Orders
CUSTOMER
CosmosDb
SQL
©2017 Couchbase Inc. 51
N1QL (Couchbase)
©2017 Couchbase Inc. 52
SQL (DocumentDb CosmosDb)
 https://www.documentdb.com/sql/demo
©2017 Couchbase Inc. 53
SQL CosmosDb SQL
SQL standard JSON stuff
©2017 Couchbase Inc. 54
Demo: N1QL
©2017 Couchbase Inc. 55
Other JSON "Stuff"
©2014 Couchbase, Inc. 55
Ranging over collections
• WHERE ANY c IN children SATISFIES c.age > 10 END
• WHERE EVERY r IN ratings SATISFIES r > 3 END
Mapping with filtering • ARRAY c.name FOR c IN children WHEN c.age > 10 END
Deep traversal, SET, and
UNSET
• WHERE ANY node WITHIN request SATISFIES node.type = “xyz” END
• UPDATE doc UNSET c.field1 FOR c WITHIN doc END
DynamicConstruction
• SELECT { “a”: expr1, “b”: expr2 } AS obj1, name FROM … // Dynamic object
• SELECT [ a, b ] FROM … // Dynamic array
Nested traversal • SELECT x.y.z, a[0] FROM a.b.c …
IS [ NOT ] MISSING • WHERE name IS MISSING
©2017 Couchbase Inc. 56
DataTypes in JSON
N1QL supports all JSON data types
 Numbers
 Strings
 Booleans
 Null
 Arrays
 Objects
©2017 Couchbase Inc. 59
Data Modification Statements
INSERT INTO `orders` (KEY, VALUE)
VALUES ("mykey", {"field1":482, "field2":3, "field3":4});
UPDATE `order`
SET field4 = "ABC987"
WHERE field1 = 482 AND field2 = 3 AND field3 = 4
DELETE FROM `neworder`
WHERE fieldX = 291 AND
fieldY = 3482 AND
fieldZ = 2483
JSON literals can be used in any
expression
©2017 Couchbase Inc. 60
Index Statements
 CREATE INDEX ON …
 DROP INDEX …
 EXPLAIN …
https://dzone.com/articles/index-first-and-query-faster
©2017 Couchbase Inc. 62
Find High-Value Customers with Orders > $10000
Query customer
objects from
database
For each customer
object
Find all the order
objects for the
customer
Calculate the total
amount for each
order
Sum up the grand
total amount for all
orders
If grand total
amount > $10000,
Extract customer
data
Add customer to
the high-value
customer list
Sort the high-value
customer list
SELECT Customers.ID, Customers.Name, SUM(OrderLine.Amount)
FROM `Orders` UNNEST Orders.LineItems AS OrderLine
JOIN `Customers` ON KEYS Orders.CustID
GROUP BY Customers.ID, Customers.Name
HAVING SUM(OrderLine.Amount) > 10000
ORDER BY SUM(OrderLine.Amount) DESC
©2017 Couchbase Inc. 63
Summary: SQL & SQL for JSON
Query Features SQL SQL for JSON
Statements
 SELECT, INSERT, UPDATE, DELETE,
MERGE
 SELECT, INSERT, UPDATE, DELETE,
MERGE
Query Operations
 Select, Join, Project, Subqueries
 Strict Schema
 StrictType checking
 Select, Join, Project, Subqueries
 Nest & Unnest
 Look Ma! NoType Mismatch Errors!
 JSON keys act as columns
Schema  Predetermined Columns
 Fully addressable JSON
 Flexible document structure
DataTypes
 SQL Data types
 Conversion Functions
 JSON Data types
 Conversion Functions
Query Processing
 INPUT: Sets ofTuples
 OUPUT: Set ofTuples
 INPUT: Sets of JSON
 OUTPUT: Set of JSON
©2017 Couchbase Inc. 64
Summary: N1QL and CosmosDB SQL
Query Features N1QL CosmosDB SQL
SELECT Yes Yes
INSERT, UPDATE, DELETE, MERGE Yes No
Intra-document join Yes: UNNEST Yes: JOIN
Inter-document join Yes: JOIN, NEST No
Aggregation (GROUP BY, SUM,MAX,MIN) Yes No GROUP BY
Stored Procedures,Triggers, UDF No Kinda (JavaScript)
©2017 Couchbase Inc. 65
SQL for JSON
SQL++
N1QL
http://tinyurl.com/UCSDsql
©2017 Couchbase Inc. 66
Couchbase Analytics (CBAS) and SQL++
©2017 Couchbase Inc. 67
©2017 Couchbase Inc. 68
Industry is Choosing SQL to Query JSON
©2017 Couchbase Inc. 69
JSON in SQL Server
©2017 Couchbase Inc. 74
Try SQL for JSON
http://tiny.cc/n1ql
http://tiny.cc/cosmosdb
©2017 Couchbase Inc. 75
Podcast
https://blog.couchbase.com/tag/podcast/
Free event:
Couchbase Day Kansas City
August 15th
http://tiny.cc/cbkc
©2017 Couchbase Inc. 77
Couchbase, everybody!
©2017 Couchbase Inc. 78
Where do you find us?
• blog.couchbase.com
• @couchbasedev
• @mgroves
• http://tiny.cc/cbkc
©2017 Couchbase Inc. 79
Frequently Asked Questions
1. How is Couchbase different than Mongo?
2. Is Couchbase the same thing as CouchDb?
3. How did you get to be both incredibly handsome and
tremendously intelligent?
4. What is the Couchbase licensing situation?
5. Is Couchbase a Managed Cloud Service?
©2017 Couchbase Inc. 80
CouchDB and Couchbase
< Back
memcached
©2017 Couchbase Inc. 81
MongoDB vs Couchbase
• Memory first architecture
• Master-master architecture
• Auto-sharding
• N1QL
• FullText Search
• Mobile & Sync
< Back
©2017 Couchbase Inc. 82
Licensing
Couchbase Server Community
• Open source (Apache 2)
• Binary release is one release behind Enterprise
• Free to use in dev/test/qa/prod
• Forum support only
Couchbase Server Enterprise
• Mostly open source (Apache 2)
• Some features not available on Community (XDCRTLS, MDS, Rack Zone, etc)
• Free to use in dev/test/qa
• Need commercial license for prod
• Paid support provided
< Back
©2017 Couchbase Inc. 83
Managed Cloud Service (DBaaS)?
No.
< Back

Más contenido relacionado

La actualidad más candente

Utilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingKeshav Murthy
 
MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011Steven Francia
 
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...MongoDB
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB
 
From SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONFrom SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONKeshav Murthy
 
How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6Maxime Beugnet
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB
 
Deciphering Explain Output
Deciphering Explain Output Deciphering Explain Output
Deciphering Explain Output MongoDB
 
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB
 
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2MongoDB
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB
 
Mongodbworkshop I: get started
Mongodbworkshop I: get startedMongodbworkshop I: get started
Mongodbworkshop I: get startedVivian S. Zhang
 
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDBMongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDBMongoDB
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.GeeksLab Odessa
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB
 
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)""Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"MongoDB
 

La actualidad más candente (17)

Utilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and Indexing
 
MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011
 
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
Creating a Single View Part 2: Loading Disparate Source Data and Creating a S...
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
 
From SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONFrom SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSON
 
How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6How to leverage what's new in MongoDB 3.6
How to leverage what's new in MongoDB 3.6
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
 
Deciphering Explain Output
Deciphering Explain Output Deciphering Explain Output
Deciphering Explain Output
 
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: TutorialMongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
MongoDB .local Chicago 2019: Practical Data Modeling for MongoDB: Tutorial
 
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
Joins and Other Aggregation Enhancements Coming in MongoDB 3.2
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
 
Mongodbworkshop I: get started
Mongodbworkshop I: get startedMongodbworkshop I: get started
Mongodbworkshop I: get started
 
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDBMongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
 
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
Java/Scala Lab: Борис Трофимов - Обжигающая Big Data.
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
 
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)""Powerful Analysis with the Aggregation Pipeline (Tutorial)"
"Powerful Analysis with the Aggregation Pipeline (Tutorial)"
 

Similar a Querying NoSQL with SQL - KCDC - August 2017

Query in Couchbase. N1QL: SQL for JSON
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSONKeshav Murthy
 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications Keshav Murthy
 
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooQuerying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooAll Things Open
 
JSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa TechfestJSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa TechfestMatthew Groves
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Keshav Murthy
 
JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020Matthew Groves
 
Json data modeling june 2017 - pittsburgh tech fest
Json data modeling   june 2017 - pittsburgh tech festJson data modeling   june 2017 - pittsburgh tech fest
Json data modeling june 2017 - pittsburgh tech festMatthew Groves
 
Putting the SQL Back in NoSQL - October 2022 - All Things Open
Putting the SQL Back in NoSQL - October 2022 - All Things OpenPutting the SQL Back in NoSQL - October 2022 - All Things Open
Putting the SQL Back in NoSQL - October 2022 - All Things OpenMatthew Groves
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5Keshav Murthy
 
Data Modeling and Relational to NoSQL
 Data Modeling and Relational to NoSQL  Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL DATAVERSITY
 
NoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseNoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseBrant Burnett
 
N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0Keshav Murthy
 
MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA TREEPTIK
 
Couchbase N1QL: Language & Architecture Overview.
Couchbase N1QL: Language & Architecture Overview.Couchbase N1QL: Language & Architecture Overview.
Couchbase N1QL: Language & Architecture Overview.Keshav Murthy
 
Data Modeling for Performance
Data Modeling for PerformanceData Modeling for Performance
Data Modeling for PerformanceMichael Dwan
 
Modeling for Performance
Modeling for PerformanceModeling for Performance
Modeling for PerformanceMongoDB
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsXavier Badosa
 
Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...EDB
 
Making Sense of Schema on Read
Making Sense of Schema on ReadMaking Sense of Schema on Read
Making Sense of Schema on ReadKent Graziano
 

Similar a Querying NoSQL with SQL - KCDC - August 2017 (20)

Query in Couchbase. N1QL: SQL for JSON
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSON
 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
 
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it tooQuerying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
 
JSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa TechfestJSON Data Modeling - July 2018 - Tulsa Techfest
JSON Data Modeling - July 2018 - Tulsa Techfest
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
 
JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020
 
Json data modeling june 2017 - pittsburgh tech fest
Json data modeling   june 2017 - pittsburgh tech festJson data modeling   june 2017 - pittsburgh tech fest
Json data modeling june 2017 - pittsburgh tech fest
 
Putting the SQL Back in NoSQL - October 2022 - All Things Open
Putting the SQL Back in NoSQL - October 2022 - All Things OpenPutting the SQL Back in NoSQL - October 2022 - All Things Open
Putting the SQL Back in NoSQL - October 2022 - All Things Open
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
 
Data Modeling and Relational to NoSQL
 Data Modeling and Relational to NoSQL  Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL
 
NoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseNoSQL Data Modeling using Couchbase
NoSQL Data Modeling using Couchbase
 
N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0
 
MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA
 
Couchbase N1QL: Language & Architecture Overview.
Couchbase N1QL: Language & Architecture Overview.Couchbase N1QL: Language & Architecture Overview.
Couchbase N1QL: Language & Architecture Overview.
 
Data Modeling for Performance
Data Modeling for PerformanceData Modeling for Performance
Data Modeling for Performance
 
Modeling for Performance
Modeling for PerformanceModeling for Performance
Modeling for Performance
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official Statistics
 
Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...Application Development & Database Choices: Postgres Support for non Relation...
Application Development & Database Choices: Postgres Support for non Relation...
 
Into The Box 2018 cbelasticsearch
Into The Box 2018   cbelasticsearchInto The Box 2018   cbelasticsearch
Into The Box 2018 cbelasticsearch
 
Making Sense of Schema on Read
Making Sense of Schema on ReadMaking Sense of Schema on Read
Making Sense of Schema on Read
 

Más de Matthew Groves

CREAM - That Conference Austin - January 2024.pptx
CREAM - That Conference Austin - January 2024.pptxCREAM - That Conference Austin - January 2024.pptx
CREAM - That Conference Austin - January 2024.pptxMatthew Groves
 
FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023Matthew Groves
 
Cache Rules Everything Around Me - DevIntersection - December 2022
Cache Rules Everything Around Me - DevIntersection - December 2022Cache Rules Everything Around Me - DevIntersection - December 2022
Cache Rules Everything Around Me - DevIntersection - December 2022Matthew Groves
 
Cache Rules Everything Around Me - Momentum - October 2022.pptx
Cache Rules Everything Around Me - Momentum - October 2022.pptxCache Rules Everything Around Me - Momentum - October 2022.pptx
Cache Rules Everything Around Me - Momentum - October 2022.pptxMatthew Groves
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Matthew Groves
 
Don't Drop ACID - Data Love - April 2021
Don't Drop ACID - Data Love - April 2021Don't Drop ACID - Data Love - April 2021
Don't Drop ACID - Data Love - April 2021Matthew Groves
 
Demystifying NoSQL - All Things Open - October 2020
Demystifying NoSQL - All Things Open - October 2020Demystifying NoSQL - All Things Open - October 2020
Demystifying NoSQL - All Things Open - October 2020Matthew Groves
 
Autonomous Microservices - Manning - July 2020
Autonomous Microservices - Manning - July 2020Autonomous Microservices - Manning - July 2020
Autonomous Microservices - Manning - July 2020Matthew Groves
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLMatthew Groves
 
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...Matthew Groves
 
Intro to SQL++ - Detroit Tech Watch - June 2019
Intro to SQL++ - Detroit Tech Watch - June 2019Intro to SQL++ - Detroit Tech Watch - June 2019
Intro to SQL++ - Detroit Tech Watch - June 2019Matthew Groves
 
Autonomous Microservices - CodeMash - January 2019
Autonomous Microservices - CodeMash - January 2019Autonomous Microservices - CodeMash - January 2019
Autonomous Microservices - CodeMash - January 2019Matthew Groves
 
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 20185 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018Matthew Groves
 
5 NoSQL Options - Toronto - May 2018
5 NoSQL Options - Toronto - May 20185 NoSQL Options - Toronto - May 2018
5 NoSQL Options - Toronto - May 2018Matthew Groves
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...Matthew Groves
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017Matthew Groves
 
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017Matthew Groves
 
I have a NoSQL Toaster - ConnectJS - October 2016
I have a NoSQL Toaster - ConnectJS - October 2016I have a NoSQL Toaster - ConnectJS - October 2016
I have a NoSQL Toaster - ConnectJS - October 2016Matthew Groves
 
Full stack development with Node and NoSQL - Austin Node.JS Group - October ...
Full stack development with Node and NoSQL -  Austin Node.JS Group - October ...Full stack development with Node and NoSQL -  Austin Node.JS Group - October ...
Full stack development with Node and NoSQL - Austin Node.JS Group - October ...Matthew Groves
 

Más de Matthew Groves (20)

CREAM - That Conference Austin - January 2024.pptx
CREAM - That Conference Austin - January 2024.pptxCREAM - That Conference Austin - January 2024.pptx
CREAM - That Conference Austin - January 2024.pptx
 
FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023FluentMigrator - Dayton .NET - July 2023
FluentMigrator - Dayton .NET - July 2023
 
Cache Rules Everything Around Me - DevIntersection - December 2022
Cache Rules Everything Around Me - DevIntersection - December 2022Cache Rules Everything Around Me - DevIntersection - December 2022
Cache Rules Everything Around Me - DevIntersection - December 2022
 
Cache Rules Everything Around Me - Momentum - October 2022.pptx
Cache Rules Everything Around Me - Momentum - October 2022.pptxCache Rules Everything Around Me - Momentum - October 2022.pptx
Cache Rules Everything Around Me - Momentum - October 2022.pptx
 
Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)Don't Drop ACID (July 2021)
Don't Drop ACID (July 2021)
 
Don't Drop ACID - Data Love - April 2021
Don't Drop ACID - Data Love - April 2021Don't Drop ACID - Data Love - April 2021
Don't Drop ACID - Data Love - April 2021
 
Demystifying NoSQL - All Things Open - October 2020
Demystifying NoSQL - All Things Open - October 2020Demystifying NoSQL - All Things Open - October 2020
Demystifying NoSQL - All Things Open - October 2020
 
Autonomous Microservices - Manning - July 2020
Autonomous Microservices - Manning - July 2020Autonomous Microservices - Manning - July 2020
Autonomous Microservices - Manning - July 2020
 
CONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQLCONDG April 23 2020 - Baskar Rao - GraphQL
CONDG April 23 2020 - Baskar Rao - GraphQL
 
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...
Background Tasks Without a Separate Service: Hangfire for ASP.NET - KCDC - Ju...
 
Intro to SQL++ - Detroit Tech Watch - June 2019
Intro to SQL++ - Detroit Tech Watch - June 2019Intro to SQL++ - Detroit Tech Watch - June 2019
Intro to SQL++ - Detroit Tech Watch - June 2019
 
Autonomous Microservices - CodeMash - January 2019
Autonomous Microservices - CodeMash - January 2019Autonomous Microservices - CodeMash - January 2019
Autonomous Microservices - CodeMash - January 2019
 
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 20185 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018
5 Popular Choices for NoSQL on a Microsoft Platform - Tulsa - July 2018
 
5 NoSQL Options - Toronto - May 2018
5 NoSQL Options - Toronto - May 20185 NoSQL Options - Toronto - May 2018
5 NoSQL Options - Toronto - May 2018
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017
 
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
 
I have a NoSQL Toaster - ConnectJS - October 2016
I have a NoSQL Toaster - ConnectJS - October 2016I have a NoSQL Toaster - ConnectJS - October 2016
I have a NoSQL Toaster - ConnectJS - October 2016
 
Full stack development with Node and NoSQL - Austin Node.JS Group - October ...
Full stack development with Node and NoSQL -  Austin Node.JS Group - October ...Full stack development with Node and NoSQL -  Austin Node.JS Group - October ...
Full stack development with Node and NoSQL - Austin Node.JS Group - October ...
 

Último

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Último (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Querying NoSQL with SQL - KCDC - August 2017

  • 1. Querying NoSQL with SQL HAVINGYour JSON Cake and SELECTing it too Matthew D. Groves, @mgroves
  • 3. ©2017 Couchbase Inc. 3 Agenda Why NoSQL? JSON Data Modeling SQL for JSON Ecosystem and convergence
  • 4. ©2017 Couchbase Inc. 4 Where am I? • KCDC (Kansas City Developer Conference) • http://kcdc.info
  • 5. ©2017 Couchbase Inc. 5 Who am I? • Matthew D. Groves • DeveloperAdvocate for Couchbase • @mgroves onTwitter • Podcast and blog: http://crosscuttingconcerns.com • “I am not an expert, but I am an enthusiast.” – Alan Stevens
  • 6. Querying NoSQL with SQL HAVINGYour JSON Cake and SELECTing it too Matthew D. Groves, @mgroves
  • 7. ©2017 Couchbase Inc. 7 Major Enterprises Across Industries are Adopting NoSQL CommunicationsTechnology Travel & Hospitality Media & Entertainment E-Commerce & DigitalAdvertising Retail & Apparel Games & GamingFinance & Business Services
  • 8. ©2017 Couchbase Inc. 8 Why NoSQL?
  • 9. ©2017 Couchbase Inc. 9 NoSQL Landscape Document • Couchbase • MongoDB • DynamoDB • DocumentDB Graph • OrientDB • Neo4J • DEX • GraphBase Key-Value • Couchbase • Riak • BerkeleyDB • Redis Wide Column • Hbase • Cassandra • Hypertable
  • 10. ©2017 Couchbase Inc. 10 NoSQL Landscape • Get by key(s) • Set by key(s) • Replace by key(s) • Delete by key(s) • Map/Reduce Document • Couchbase • MongoDB • DynamoDB • DocumentDB
  • 11. ©2017 Couchbase Inc. 11 Why NoSQL? Scalability
  • 12. ©2017 Couchbase Inc. 12 Why NoSQL? Scalability
  • 13. ©2017 Couchbase Inc. 13 Why NoSQL? Flexibility
  • 14. ©2017 Couchbase Inc. 14 Why NoSQL? Performance
  • 15. ©2017 Couchbase Inc. 15 Why NoSQL? Availability
  • 16. ©2017 Couchbase Inc. 16 JSON Data Modeling
  • 17. ©2017 Couchbase Inc. 17 Models for Representing Data Data Concern Relational Model JSON Document Model Rich Structure Relationships Value Evolution Structure Evolution
  • 18. ©2017 Couchbase Inc. 18 Properties of Real-World Data
  • 19. ©2017 Couchbase Inc. 19 Modeling Data in RelationalWorld Billing ConnectionsPurchases Contacts Customer
  • 20. CustomerID Name DOB CBL2015 Jane Smith 1990-01-30 Table: Customer { "Name" : "Jane Smith", "DOB" : "1990-01-30” } Customer DocumentKey: CBL2015
  • 21. ©2017 Couchbase Inc. 21 CustomerID Name DOB CBL2015 Jane Smith 1990-01-30 Table: Customer { "Name" : "Jane Smith", "DOB" : "1990-01-30", "Purchases" : [ { "item" : "laptop", "amount" : 1499.99, "date" : "2019-03", } ] } Customer DocumentKey: CBL2015 CustomerID Item Amount Date CBL2015 laptop 1499.99 2019-03 Table: Purchases
  • 22. CustomerID Name DOB CBL2015 Jane Smith 1990-01-30 Table: Customer { "Name" : "Jane Smith", "DOB" : "1990-01-30", "Purchases" : [ { "item" : "laptop", "amount" : 1499.99, "date" : "2019-03", }, { "item" : "phone", "amount" : 99.99, "date" : "2018-12" } ] } Customer DocumentKey: CBL2015 CustomerID Item Amount Date CBL2015 laptop 1499.99 2019-03 CBL2015 phone 99.99 2018-12 Table: Purchases
  • 23. CustomerID ConnId Name CBL2015 XYZ987 Joe Smith CBL2015 SKR007 Sam Smith Table: Connections { "Name" : "Jane Smith", "DOB" : "1990-01-30", "Billing" : [ { "type" : "visa", "cardnum" : "5827-2842-...", "expiry" : "2019-03" }, ... ], "Connections" : [ { "ConnId" : "XYZ987", "Name" : "Joe Smith" }, { "ConnId" : ”SKR007", "Name" : ”Sam Smith" } } Customer DocumentKey: CBL2015
  • 24. ©2017 Couchbase Inc. 24 { "Name" : "Jane Smith", "DOB" : "1990-01-30", "cardnum" : "5827-2842…", "expiry" : "2019-03", "cardType" : "visa", "Connections" : [ { "CustId" : "XYZ987", "Name" : "Joe Smith" }, { "CustId" : "PQR823", "Name" : "Dylan Smith" } { "CustId" : "PQR823", "Name" : "Dylan Smith" } ], "Purchases" : [ { "id":12, item: "mac", "amt": 2823.52 } { "id":19, item: "ipad2", "amt": 623.52 } ] } DocumentKey: CBL2015 Custome rID Name DOB Cardnum Expiry CardType CBL2015 Jane Smith 1990-01-30 5827- 2842… 2019-03 visa CustomerID ConnId Name CBL2015 XYZ987 Joe Smith CBL2015 SKR007 Sam Smith CustomerID item amt CBL2015 mac 2823.52 CBL2015 ipad2 623.52 CustomerID ConnId Name CBL2015 XYZ987 Joe Smith CBL2015 SKR007 Sam Smith Contacts Customer ConnectionsPurchases
  • 25. { "Name" : "Jane Smith", "DOB" : "1990-01-30", "Billing" : [ { "type" : "visa", "cardnum" : "5827-2842-2847-3909", "expiry" : "2019-03" }, { "type" : "master", "cardnum" : "6274-2842-2847-3909", "expiry" : "2019-03" } ], "Connections" : [ { "CustId" : "XYZ987", "Name" : "Joe Smith" }, { "CustId" : "PQR823", "Name" : "Dylan Smith" } { "CustId" : "PQR823", "Name" : "Dylan Smith" } ], "Purchases" : [ { "id":12, item: "mac", "amt": 2823.52 } { "id":19, item: "ipad2", "amt": 623.52 } ] } DocumentKey: CBL2015 CustomerID Name DOB CBL2015 Jane Smith 1990-01-30 Customer ID Type Cardnum Expiry CBL2015 visa 5827… 2019-03 CBL2015 master 6274… 2018-12 CustomerID ConnId Name CBL2015 XYZ987 Joe Smith CBL2015 SKR007 Sam Smith CustomerID item amt CBL2015 mac 2823.52 CBL2015 ipad2 623.52 CustomerID ConnId Name CBL2015 XYZ987 Joe Smith CBL2015 SKR007 Sam Smith Contacts Customer Billing ConnectionsPurchases
  • 26. ©2017 Couchbase Inc. 26 Models for Representing Data Data Concern Relational Model JSON Document Model (NoSQL) Rich Structure  Multiple flat tables  Constant assembly / disassembly  Documents  No assembly required! Relationships  Represented  Queried (SQL)  Represented  Queried? Not until now… Value Evolution  Data can be updated  Data can be updated Structure Evolution  Uniform and rigid  Manual change (disruptive)  Flexible  Dynamic change
  • 27. ©2017 Couchbase Inc. 27 SQL for JSON
  • 28. ©2017 Couchbase Inc. 28 Why SQL for JSON?
  • 29. ©2017 Couchbase Inc. 29 Client Side Querying is Inadequate Example: Find High-Value Customers with Orders > $10000 Query ‘customer’ objects from database For each ‘customer’ object Find all the ‘order’ objects for the ‘customer’ Calculate the total amount for each ‘order’ Sum up the grand total amount for all ‘orders’ If grand total amount > $10000, Extract ‘customer’ data Add ‘customer’ to the high-value customer list Sort the high-value customer list
  • 30. ©2017 Couchbase Inc. 30 Goal of Query for JSON Give developers and enterprises an expressive, powerful, and complete language for querying, transforming, and manipulating JSON data.
  • 32. ©2017 Couchbase Inc. 32 route_5966 ← key { "type": "route", ← document type identifier "airlineid": "airline_24", ← foreign key "sourceairport": "MCO", "destinationairport": "SEA", "equipment": "737", "schedule": [ {"day": 1, "utc": "13:25:00", "flight": "AA788"}, {"day": 4, "utc": "13:25:00", "flight": "AA419"}, {"day": 5, "utc": "13:25:00", "flight": "AA519"} ] }
  • 33. ©2017 Couchbase Inc. 33 airline_24 ← key { "active": "Y", "callsign": "AMERICAN", "country": "United States", "iata": "AA", "icao": "AAL", "name": "American Airlines", "type": "airline" ← document type identifier }
  • 34. ©2017 Couchbase Inc. 34 SELECT: JOIN
  • 35. ©2017 Couchbase Inc. 35 SELECT: Aggregation
  • 36. ©2017 Couchbase Inc. 36 SELECT: Aggregation MIN MAX SUM COUNT AVG ARRAY_AGG [ DISTINCT ]
  • 37. ©2017 Couchbase Inc. 37 SELECT: UNION, UNION ALL, INTERSECT, EXCEPT
  • 38. ©2017 Couchbase Inc. 38 USE KEYS
  • 39. ©2017 Couchbase Inc. 39 UNNEST (aka JOIN)
  • 40. ©2017 Couchbase Inc. 40 UNNEST (aka JOIN)
  • 41. ©2017 Couchbase Inc. 41 UNNEST (aka JOIN)
  • 42. ©2017 Couchbase Inc. 42 UNNEST (aka JOIN)
  • 43. ©2017 Couchbase Inc. 46 Composability JOIN, NEST, and UNNEST can be chained in any combination
  • 44. ©2017 Couchbase Inc. 47 SELECT Statement SELECT customers.id, customers.NAME.lastname, customers.NAME.firstname Sum(orderline.amount) FROM `orders` UNNEST orders.lineitems AS orderline JOIN `customers` ON KEYS orders.custid WHERE customers.state = 'NY' GROUP BY customers.id, customers.NAME.lastname HAVING sum(orderline.amount) > 10000 ORDER BY sum(orderline.amount) DESC • Dotted sub-document reference • Names are CASE-SENSITIVE • UNNEST to flatten the arrays JOINS with Document KEY of customers
  • 45. ©2017 Couchbase Inc. 49 ResultSet
  • 46. ©2017 Couchbase Inc. 50 { "Name" : "Jane Smith", "DOB" : "1990-01-30", "Billing" : [ { "type" : "visa", "cardnum" : "5827-2842-2847-3909", "expiry" : "2019-03" }, { "type" : "master", "cardnum" : "6274-2842-2847-3909", "expiry" : "2019-03" } ], "Connections" : [ { "CustId" : "XYZ987", "Name" : "Joe Smith" }, { "CustId" : "PQR823", "Name" : "Dylan Smith" } { "CustId" : "PQR823", "Name" : "Dylan Smith" } ], "Purchases" : [ { "id":12, item: "mac", "amt": 2823.52 } { "id":19, item: "ipad2", "amt": 623.52 } ] } LoyaltyInfo ResultDocuments Orders CUSTOMER CosmosDb SQL
  • 47. ©2017 Couchbase Inc. 51 N1QL (Couchbase)
  • 48. ©2017 Couchbase Inc. 52 SQL (DocumentDb CosmosDb)  https://www.documentdb.com/sql/demo
  • 49. ©2017 Couchbase Inc. 53 SQL CosmosDb SQL SQL standard JSON stuff
  • 50. ©2017 Couchbase Inc. 54 Demo: N1QL
  • 51. ©2017 Couchbase Inc. 55 Other JSON "Stuff" ©2014 Couchbase, Inc. 55 Ranging over collections • WHERE ANY c IN children SATISFIES c.age > 10 END • WHERE EVERY r IN ratings SATISFIES r > 3 END Mapping with filtering • ARRAY c.name FOR c IN children WHEN c.age > 10 END Deep traversal, SET, and UNSET • WHERE ANY node WITHIN request SATISFIES node.type = “xyz” END • UPDATE doc UNSET c.field1 FOR c WITHIN doc END DynamicConstruction • SELECT { “a”: expr1, “b”: expr2 } AS obj1, name FROM … // Dynamic object • SELECT [ a, b ] FROM … // Dynamic array Nested traversal • SELECT x.y.z, a[0] FROM a.b.c … IS [ NOT ] MISSING • WHERE name IS MISSING
  • 52. ©2017 Couchbase Inc. 56 DataTypes in JSON N1QL supports all JSON data types  Numbers  Strings  Booleans  Null  Arrays  Objects
  • 53. ©2017 Couchbase Inc. 59 Data Modification Statements INSERT INTO `orders` (KEY, VALUE) VALUES ("mykey", {"field1":482, "field2":3, "field3":4}); UPDATE `order` SET field4 = "ABC987" WHERE field1 = 482 AND field2 = 3 AND field3 = 4 DELETE FROM `neworder` WHERE fieldX = 291 AND fieldY = 3482 AND fieldZ = 2483 JSON literals can be used in any expression
  • 54. ©2017 Couchbase Inc. 60 Index Statements  CREATE INDEX ON …  DROP INDEX …  EXPLAIN … https://dzone.com/articles/index-first-and-query-faster
  • 55. ©2017 Couchbase Inc. 62 Find High-Value Customers with Orders > $10000 Query customer objects from database For each customer object Find all the order objects for the customer Calculate the total amount for each order Sum up the grand total amount for all orders If grand total amount > $10000, Extract customer data Add customer to the high-value customer list Sort the high-value customer list SELECT Customers.ID, Customers.Name, SUM(OrderLine.Amount) FROM `Orders` UNNEST Orders.LineItems AS OrderLine JOIN `Customers` ON KEYS Orders.CustID GROUP BY Customers.ID, Customers.Name HAVING SUM(OrderLine.Amount) > 10000 ORDER BY SUM(OrderLine.Amount) DESC
  • 56. ©2017 Couchbase Inc. 63 Summary: SQL & SQL for JSON Query Features SQL SQL for JSON Statements  SELECT, INSERT, UPDATE, DELETE, MERGE  SELECT, INSERT, UPDATE, DELETE, MERGE Query Operations  Select, Join, Project, Subqueries  Strict Schema  StrictType checking  Select, Join, Project, Subqueries  Nest & Unnest  Look Ma! NoType Mismatch Errors!  JSON keys act as columns Schema  Predetermined Columns  Fully addressable JSON  Flexible document structure DataTypes  SQL Data types  Conversion Functions  JSON Data types  Conversion Functions Query Processing  INPUT: Sets ofTuples  OUPUT: Set ofTuples  INPUT: Sets of JSON  OUTPUT: Set of JSON
  • 57. ©2017 Couchbase Inc. 64 Summary: N1QL and CosmosDB SQL Query Features N1QL CosmosDB SQL SELECT Yes Yes INSERT, UPDATE, DELETE, MERGE Yes No Intra-document join Yes: UNNEST Yes: JOIN Inter-document join Yes: JOIN, NEST No Aggregation (GROUP BY, SUM,MAX,MIN) Yes No GROUP BY Stored Procedures,Triggers, UDF No Kinda (JavaScript)
  • 58. ©2017 Couchbase Inc. 65 SQL for JSON SQL++ N1QL http://tinyurl.com/UCSDsql
  • 59. ©2017 Couchbase Inc. 66 Couchbase Analytics (CBAS) and SQL++
  • 61. ©2017 Couchbase Inc. 68 Industry is Choosing SQL to Query JSON
  • 62. ©2017 Couchbase Inc. 69 JSON in SQL Server
  • 63. ©2017 Couchbase Inc. 74 Try SQL for JSON http://tiny.cc/n1ql http://tiny.cc/cosmosdb
  • 64. ©2017 Couchbase Inc. 75 Podcast https://blog.couchbase.com/tag/podcast/
  • 65. Free event: Couchbase Day Kansas City August 15th http://tiny.cc/cbkc
  • 66. ©2017 Couchbase Inc. 77 Couchbase, everybody!
  • 67. ©2017 Couchbase Inc. 78 Where do you find us? • blog.couchbase.com • @couchbasedev • @mgroves • http://tiny.cc/cbkc
  • 68. ©2017 Couchbase Inc. 79 Frequently Asked Questions 1. How is Couchbase different than Mongo? 2. Is Couchbase the same thing as CouchDb? 3. How did you get to be both incredibly handsome and tremendously intelligent? 4. What is the Couchbase licensing situation? 5. Is Couchbase a Managed Cloud Service?
  • 69. ©2017 Couchbase Inc. 80 CouchDB and Couchbase < Back memcached
  • 70. ©2017 Couchbase Inc. 81 MongoDB vs Couchbase • Memory first architecture • Master-master architecture • Auto-sharding • N1QL • FullText Search • Mobile & Sync < Back
  • 71. ©2017 Couchbase Inc. 82 Licensing Couchbase Server Community • Open source (Apache 2) • Binary release is one release behind Enterprise • Free to use in dev/test/qa/prod • Forum support only Couchbase Server Enterprise • Mostly open source (Apache 2) • Some features not available on Community (XDCRTLS, MDS, Rack Zone, etc) • Free to use in dev/test/qa • Need commercial license for prod • Paid support provided < Back
  • 72. ©2017 Couchbase Inc. 83 Managed Cloud Service (DBaaS)? No. < Back

Notas del editor

  1. Please make sure to visit the sponsors and say thank you. They make this great event possible. Couchbase is here too, if you have questions or just want to talk databases, please come on by!
  2. Spend just a little time on why people are using NoSQL Talk about how data is modeled differently in JSON Let’s talk about why SQL is good and why SQL for JSON is needed Let’s talk about the exciting stuff happening in the database ecosystem Including but not limited to the stuff Couchbase is doing If we have time, we’ll look at how a .NET developer (or Java developer, etc) would interact with SQL for JSON
  3. What’s also interesting is that we’re seeing the use of NoSQL expand inside many of these companies. Orbitz, the online travel company, is a great example – they started using Couchbase to store their hotel rate data, and now they use Couchbase in many other ways. Same with ebay, they recently presented at the Couchbase conference with a chart tracking how many instances of various nosql databases are in use, and we see growth in Cassandra, mongo, and couchbase has actually surpassed them within ebay Marriott is using Couchbase, so you may be interacting with it right now
  4. SQL (relational) databases are great. They give you LOT OF functionality. Great set of abstractions (tables, columns, data types, constraints, triggers, SQL, ACID TRANSACTIONS, stored procedures and more) at a highly reasonable cost. Change is inevitable One thing RDBMS does not handle well is CHANGE. Change of schema (both logical and physical), change of hardware, change of capacity. NoSQL databases ESPECIALLY ONES DESIGNED TO BE DISTRIBUTED tend to help solve problems with: agility, scalability, performance, and availability
  5. Let’s talk about what NoSQL is, first. NoSQL generally refers to databases which lack SQL or don’t use a relational model Once the SQL language, transaction became optional, flurry of databases were created using distinct approaches for common use-cases. KEY-Value simply provided quick access to data for a given KEY. Wide Column databases can store large number of arbitrary columns in each row Graph databases store data and relationships as first class concepts Document databases aggregate data into a hierarchical structure. With JSON is a means to the end. Document databases provide flexible schema,built-in data types, rich structure, implicit relationships using JSON.
  6. When we look at document databases, they originally came with a Minimal set of APIs and features But as they continue to mature, we’re seeing more features being added And generally I’m seeing a convergent trend between SQL and NoSQL But anyway, this set of minimal features, lacking a SQL language and tables gives us the buzzword “nosql”
  7. Elastic scaling Size your cluster for today Scale out on demand Cost effective scaling Commodity hardware On premise or on cloud Scale OUT instead of Scale UP [example: changing the channel to a soccer game or Game of Thrones, everyone makes the same API request in the same 5 minutes] [example: TV show lets watchers vote during some period of the week, so you can scale up during that period of time] [example: black Friday]
  8. Elastic scaling Size your cluster for today Scale out on demand Cost effective scaling Commodity hardware On premise or on cloud Scale OUT instead of Scale UP [example: changing the channel to a soccer game or Game of Thrones, everyone makes the same API request in the same 5 minutes] [example: TV show lets watchers vote during some period of the week, so you can scale up during that period of time] [example: black Friday]
  9. Schema flexibility Easier management of change in the business requirements Easier management of change in the structure of the data Sometimes you're pulling together data, integrating from different sources (e.g. ELT) and that flexibility helps Document database means that you have no rigid schema. You can do whatever the heck you want. That being said, you SHOULDN’T. You should still have discipline about your data.
  10. NoSQL systems are optimized for specific access patterns Low response time for web & mobile user experience Millisecond latency Consistently high throughput to handle growth [perf measures can be subjective – talk about architecture, integrated cache, maybe mention MDS too]
  11. If one tap for pepsi goes out, there’s others available. If one db node goes down, the others will compensate. This is related to scaling Built-in replication and fail-over No application downtime when hardware fails Online maintenance & upgrade No application downtime
  12. Let’s talk about data modeling a bit, because storing data in JSON Is different that storing in tables.
  13. So I want to compare the approaches over 4 key areas. I’m going to fill in this table, traditional SQL on the left and JSON on the right
  14. Let’s look at modeling Customer data. This is an example of what a customer might look like There is a rich structure: attributes, potentially sub-attributes (first name and last name) Relationships: to other data (other customers, to products perhaps) Value evolution: Maybe we’d start with one billing option, change to multiple (data is updated) Structure evolution: Maybe we start without connections and add those later, or we evolve name field to be more than first and last name (data is reshaped)
  15. Rich Structure In relational database, this customers data would be stored in five normalized tables. Each time you want to construct a customer object, you JOIN the data in these tables; Each time you persist, you find the appropriate rows in relevant tables and insert/update. Relationship Enforcement is via referential constraints. Objects are constructed by JOINS, EACH time. Value Evolution Additional values of the SAME TYPE (e.g. additional phone, additional address) is managed by additional ROWS in one of the tables. Customer:contacts will have 1:n relationship. Structure Evolution: Imagine we didn't start with a billing table. This is the most difficult part. Changing the structure is difficult, within a table, across tables. While you can do these via ALTER TABLE, requires downtime, migration and application versioning. This is one of the problem document databases try to handle by representing data in JSON.
  16. Let’s see how to represent customer data in JSON. The primary (CustomerID) becomes the DocumentKey Column name-Column value becomes KEY-VALUE pair.
  17. We aren’t normal form anymore Rich Structure & Relationships Billing information is stored as a sub-document There could be more than a single credit card. So, use an array.
  18. Value evolution Simply add additional array element or update a value.
  19. Structure evolution Simply add new key-value pairs No downtime to add new KV pairs Applications can validate data Structure evolution over time. Relations via Reference
  20. So, finally, you have a JSON document that represents a CUSTOMER. In a single JSON document, relationship between the data is implicit by use of sub-structures and arrays and arrays of sub-structures.
  21. So, finally, you have a JSON document that represents a CUSTOMER. In a single JSON document, relationship between the data is implicit by use of sub-structures and arrays and arrays of sub-structures.
  22. Reference slide
  23. I think there's a piece that's missing in many NoSQL databases: robust query capabilities NoSQL systems provide specialized APIs Key-Value get and set Script based query APIs Limited declarative query Map/reduce can be nice, but it does make certain operations harder. Plus it may not feel as natural as SQL if you’ve been using that for decades. (joins, unions, etc)
  24. This is how you might have to do it WITHOUT a query language like SQL Complex code and logic Inefficient processing on client side I can do this with k/v calls, map/reduce calls sure, but it’s more complex, and maybe inefficient Less complex, more natural to do this in SQL, more readable
  25. SQL is meant for normalized data so what do we do when we have denormalized data, like JSON documents?
  26. So let’s look at how SQL for JSON should work I’m going to use a different model as an example: Travel data. Specifically airlines and routes. I want users to be able to find flights between given destinations On a specific day, etc The data I’m looking at is actually a sample data set that ships with Couchbase Called the “travel sample” bucket It has airlines, routes, airports, and landmarks, but we’re only going to look at airlines and routes today.
  27. Here is a sample route document Notice it has a source and destination It also has a “type”, which I won’t need but I may in the future Notice it has an airlineid field, which is kinda like a foreign key It has a schedule field, which is an array. In relational, this would typically Be 3 rows in another table, but it’s denormalized into a single document
  28. Here’s an airline sample document It’s flat data, but it contains the name of the airline It also has a “type” field that I also don’t need today but might in the future, or I might need for other use cases
  29. Go fast over these, since it’s just SQL
  30. Go fast over these, since it’s just SQL
  31. ARRAY_AGG – array of the non MISSING values in the group, including nulls ARRAY_AGG can optionally use DISTINCT
  32. Go fast over these, since it’s just SQL
  33. USE is like WHERE for document keys Direct primary key lookup bypassing index scans Ideal for hash-distributed datastore Available in SELECT, UPDATE, DELETE
  34. UNNEST is an “intra-document” join UNNEST, flattens it out to the same level Flattening JOIN that surfaces nested objects as top-level documents Ideal for decomposing JSON hierarchies
  35. UNNEST is an “intra-document” join UNNEST, flattens it out to the same level Flattening JOIN that surfaces nested objects as top-level documents Ideal for decomposing JSON hierarchies
  36. UNNEST is an “intra-document” join UNNEST, flattens it out to the same level Flattening JOIN that surfaces nested objects as top-level documents Ideal for decomposing JSON hierarchies
  37. UNNEST is an “intra-document” join UNNEST, flattens it out to the same level Flattening JOIN that surfaces nested objects as top-level documents Ideal for decomposing JSON hierarchies
  38. NEST, create a json array in the query result, it’s like the opposite of UNNEST Special JOIN that embeds external child documents under their parent Ideal for JSON encapsulation
  39. NEST, create a json array in the query result, it’s like the opposite of UNNEST Special JOIN that embeds external child documents under their parent Ideal for JSON encapsulation
  40. NEST, create a json array in the query result, it’s like the opposite of UNNEST Special JOIN that embeds external child documents under their parent Ideal for JSON encapsulation
  41. I didn’t cover NEST, but it’s another type of JOIN
  42. Dot notation for json documents, hierarchy JOIN only works on document keys right now UNNEST to flatten array, kinda like a join within a document itself… flattening
  43. Go fast over these, since it’s just SQL
  44. SQL language operates on set of relations (table) and then projects another relation (table) Resultset, needs to be mapped to something in application (could be complex, or maybe not), and then you have to map that to complex objects, and then to json Not as natural
  45. N1QL is a superset of SQL designed for JSON. Input is set of related sets of JSON documents. It operates on these documents and produces another set of JSON documents.
  46. DocumentDb is Microsoft’s document database azure offering It has a SQL syntax available, and it’s pretty good (side note: It has JOIN in its syntax but it’s an intra-document join so it’s more like UNNEST)
  47. N1QL is a superset of SQL Additionally, N1QL extends the language to support: -- Fully address, access and modify any part of the JSON document. -- Handle the full flexible schema where schema is self-described by each document. -- key-value pairs could be missing, data types could change and structure could change!
  48. These are the additions to SQL to deal with JSON Mention MISSING, it’s semantically different from a field with a null value. A field isn’t there (which is possible with a flexible schema) Ranging over collections, deep traversal might not be in CosmosDb yet
  49. Arrays and Objects are not in traditional SQL -- -There are date function for string and numeric encodings - There is no “date” type in JSON, so we store as UNIX timestamp and N1QL has functions for that - Well-defined semantics for ORDER BY and comparison operators - Defined JSON expression semantics for all input data types, so goodbye type mismatch errors - You can SELECT a string as an integer (conversion functions)
  50. I’ve already mentioned the concept of “missing” Couchbase can be used to store binary data, and there is some limited N1QL functionality associated with that But that’s a pretty non-typical use case
  51. Note: Couchbase provides per-document atomicity. So the UPDATE is not all-or-nothing, failure/success is per document We don’t have transactions CosmosDb doesn't offer these
  52. JSON in, JSON out
  53. Indexes are important, just like in SQL https://dzone.com/articles/index-first-and-query-faster Functional indexes: on any data expression Partial indexes Some other profiling/monitoring tools coming in 5.0, you can check out a developer build of 5.0 now Indexing in CosmosDb doesn’t use SQL, but it is available with, say, the .NET SDK
  54. Just like SQL (primary index is on the document key) Secondary Index can be created on any combination of attribute names. Useful in speeding up the queries. Need to have matching indices with right key-ordering Dotted notation here, CosmosDb uses a different syntax for indexing, which is more like xpath for json
  55. Top: Complex code and logic Inefficient processing on client side Bottom: Proven and expressive query language Leverage SQL skills and ecosystem Extended for JSON - More readable
  56. Reference/summary slide
  57. This chart is not exhaustive, but I think it identifies key points of difference Sprocs on CosmosDb are in Javascript, not SQL
  58. UC San Diego: SQL++ Couchbase: N1QL SQL++ is a paper that UC San Diego produced N1QL is pretty much the first implementation of SQL++, validating their paper in a real database
  59. Couchbase Analytics is currently a standalone developer preview of a feature that is coming to Couchbase Server. This uses a language that looks like N1QL, is going to converge with N1QL, but has some additional features. It’s intended for analytics, reports, trend analysis, so Couchbase Analytics is not meant to be operational: no direct reads and writes. You can join any field to any other field It’s a public PREVIEW right now, so it is available for you to get, but lots of stuff will change and we don’t recommend it for production.
  60. JSON support in SQL IBM Informix Oracle PostgreSQL MySQL All the sql vendors are introducing JSON features
  61. SQL Server 2016 introduced JSON_VALUE and some other JSON functions It’s not quite a SQL for JSON implementation, but it’s a step in that direction Here’s a table with two rows, one is an nvarchar with a JSON string JSON_VALUE can be applied to it to parse the JSON and get specific values
  62. All of these tools are using JDBC/ODBC driver provided by Simba to connect to Couchbase ODBC opens the door to a ton of integrations, these are just a few Maybe mention Crystal Reports too
  63. Couchbase can integrate directly with big data tools using DCP/XDCR instead of a query These don't rely on ODBC but are built specifically to connect to Couchbase For mongo to couchbase, we have ottoman, which has a very close API to mongoose
  64. No ODBC driver afaik (yet) But there are some interesting APIs being provided by CosmosDb and now by CosmosDb DocumentDb provides a mongo API, so you can switch seamlessly With CosmosDb, it's multi-model, so it can work as a graph database using the Gremlin language It can work as a Table database using the Azure Table Storage API So there may be some integrations out there that use those It's important to remember that compared to Couchbase and many other document databases, DocumentDb is very new, so features will come in time. Similarly, compared to Oracle and SQL Server, document databases in general are relatively new, so there are new features And innovations happening every year
  65. Documentdb.com link still works as of 7/18/2017 Even though the name has been changed
  66. Hosted by couchbase, but we have guests from all different companies to talk about nosql We recently had Kirill Gavrylyuk from the DocumentDb team on an episode, so check that out We've had guests on to talk about Raven, Marten, Mongo, Cassandra, Realm, etc
  67. Start the animation
  68. Open source apache license for community edition, enterprise edition on a faster release schedule, some advanced features, and support license. Couchbase is software you can run in the cloud on a VM or on your own data center. CosmosDb is a manage cloud service, but there is a emulator you can run locally.
  69. Couchbase is the company, Couchbase Server is the software So imagine if Mongo and Redis companies formed a new company named RedMongo, and a new database combining Redis and Mongo together called RedMongo Server
  70. Memory first: integrated cache, you don't need to put redis on top of couchbase Master-master: easier scaling, better scaling Auto-sharding: we call vBuckets, you don't have to come up with a sharding scheme, it's done by crc32 N1QL: SQL, mongo has a more limited query language and it's not SQL-like Full Text Search: Using the bleve search engine, language aware FTS capabilities built in Mobile & sync: Mongo has nothing like the offline-first and sync capabilities couchbase offers Mongo DOES have a DbaaS cloud provider
  71. Everything I've shown you today is available in Community edition The only N1QL feature I can think of not in Community is INFER The Enterprise features you probably don't need unless you are Enterprise developer.
  72. Not yet. We've been talking about it at least as long as I've been with Couchbase. It's partly a technical problem, may need additional features for multi-tenant. It's partly (mostly) a business problem. Would this be worth it? Couchbase IS in the Azure and AWS marketplaces, and there are some wizards to make config easy, but it runs on your VMs.