Post on 20-Aug-2015
NoSQL Advanced Query Languages
Using specialization and standards to drive NoSQL database selection
Host: Dan McCreary, Kelly-McCreary & Associates
Guest: Matthias Brantner, 28msec
2Kelly-McCreary & Associates
Reminder
• Registration is open!
• Preview of many of the topics being discussed at the
conference
• Link: http://nosqlnow.com/
3Kelly-McCreary & Associates
Summary
This webinar will cover the latest trends in advanced query languages
for NoSQL databases. We’ll look at how innovations in vendor-
independent standardized query languages allow NoSQL developers to
query multiple types of data and multiple NoSQL databases using a
single query language. We’ll see how using the right NoSQL query
language promotes portability across multiple NoSQL databases, avoids
vendor lock-in, and keeps your developers productive at the same
time. We will be interviewing Matthias Brantner from 28msec and see
on how they use JSONiq as a basis for a modern ETL framework that
works on a diverse number of data sources.
4Kelly-McCreary & Associates
About Us
• Working with NoSQL since 2006
• Co-founders of the NoSQL Now! conference
• Authors of Manning book on NoSQL (MEAP now, print June
2013)
• Guide for managers with a focus on business benefits
• Focus on NoSQL architectural tradeoff analysis
• Published a variety of research papers on the general topics of
query processing and optimization
• Expert on XML and JSON query languages
• Studied Information Systems at the University of Mannheim and
acquired a PhD based on his research on "Rewriting Declarative
Query Language"
• Has more than 15 years of experience in database and query
technologies
High Level NoSQL Patterns
Relational Analytical (OLAP) Key-Value
Column-Family DocumentGraph
key value
key value
key value
key value
5
Query Languages
Relational: SQL
Analytical: MDX (Cubes, Categories, Measures)
key value
key value
key value
key value
Key Value Store: None (PUT, GET, DELETE)
Column Family: HIVE, PIG
Graph: SPARQL, proprietary
Document: XQuery, JSONiq
Distributed Computing = Distributed Queries
Traditional: Send data between nodes for "distributed joins"
NoSQL: Send queries to each node
CPU
Disk
Query
Node
CPU
Disk
CPU
Disk
CPU
Disk
CPU
Disk
Query
Response
Data
Nodes
Do we need 75 APIs?
"If we have 75 NoSQL databases with 75
different APIs the NoSQL movement will
never become mainstream."
Michael Stonebreaker
http://cacm.acm.org/blogs/blog-cacm/99512-why-enterprises-are-uninterested-in-nosql/fulltext
http://hpts.ws/papers/2011/sessions_2011/Stonebraker.pdf
8
SQL is a Platform
App1 App2 App3
RDBMS1 RDBMS2 RDBMS3
SQL ODBC, JDBC
Third Party
Applications
9
NoSQL is Not Yet a Platform
App1 App2 App3
NoSQL1 NoSQL2 NoSQL3
?
Third Party
Applications
Can NoSQL have a standard
API or query language?
1
0
11Kelly-McCreary & Associates
Types of Data
Read Mostly
Read/Write
StructuredUnstructured
Transactional
RDBMS BI/DWWeb Crawlers
Documents
Log Files
XML
JSON
Binary
Open Linked Data
Graph
12Kelly-McCreary & Associates
Diverse Needs of Databases
• Security and RBAC
• Transaction Control
• Analysis - Aggregates
• Search and Findability – XQuery fulltext, Lucene
• Spatial Queries
• Control over Clusters and Remote Data Centers• fast vs. reliable for both reads and writes
• Consistency vs. Availability
13Kelly-McCreary & Associates
Metcalf's Law and Standards
• Standards lower IT
costs
• Standard tools
• Standard libraries
• Standard training
XML
RSS
XForms
REST
Many Interfaces or One?
14
DB4
DB1
DB2
DB3DB5
DB6
Db7
App
DB1
DB2
DB3
DB4
DB5
DB6
DB7
Std
App
Send Data to Nodes or Queries to Nodes?
15Kelly-McCreary & Associates
Standards Drive Lower Costs
• Consistent data formats
• Standardize with public data
• Example: postal code address standards
• Open linked data
• Data consistency
• Social network verifiability
• Standardized tools
• Standardize rules
• XML Schema
16Kelly-McCreary & Associates
Service Insulation
• Services separate applications from databases
Corporate Data Services
App1 App2 App3
NoSQL1 NoSQL2 NoSQL3
17Kelly-McCreary & Associates
Adaptors Are Inevitable!
• One library runs on may browsers – don't use proprietary APIs!
HTML
Page 1
HTML
Page 2
HTML
Page 3
18Kelly-McCreary & Associates
De facto Standards
• Some interfaces achieve a dominant position by public
acceptance or market forces (such as early entrance to the
market).
• Example: Amazon S3
http://en.wikipedia.org/wiki/De_facto_standard
19Kelly-McCreary & Associates
Standard for Key-Value Stores
• Note: APIs are simple but security models are non-trivial
App1 App2
S3 API (PUT, GET, DELETE)
S3 Security Models
App3
20Kelly-McCreary & Associates
Challenges with Adaptors
• Added complexity
• Debugging
• Match of semantics
• Performance concerns
• Added level of indirection
• Native interfaces are always faster
• Training
• What standard can you use?
• Security
• Variety of security models for data access
21Kelly-McCreary & Associates
One Language for All
http://xsparql.deri.org/
SQLXQuery/JSONiq
Graph
XSPARQLKey-Value
Library
22Kelly-McCreary & Associates
One Database, Many Interfaces
ODBC, JDBC
SPARQL
Document
Store
Triple
Store
TablesKey Value
Store
Future DB
get, put
XQuery
JSONiq
Standards/Diversity Leadership
Standards
Diversity
SQL
NoSQL
ideal
world
23
Many Types of Data
Goal: One Language
JSONiq
27Kelly-McCreary & Associates
Summary
1. NoSQL solutions use many diverse data formats from simple key-
value pairs to complex documents
2. NoSQL today has limited third party developers and limited use by
large companies due to concerns about application portability
3. New "common query languages" like JSONiq can handle multiple
sources in a single robust query language
4. Find out more at the NoSQL Now! conference
28Kelly-McCreary & Associates
See Matthias In Person!
Do More with MongoDB and JSONiq
Matthias Brantner CTO 28msec, Inc.
http://nosql2013.dataversity.net/sessionPop.cfm?confid=7
4&proposalid=5522
• Link: http://nosqlnow.com/
29Kelly-McCreary & Associates
References
• JSONiq Language Specification: http://jsoniq.org
• Demo queries used during the webinar: http://28.io/demo
• Free JSONiq book: http://www.28.io/jsoniq-the-sql-of-nosql/
• 28msec Twitter: http://twitter.com/28msec
• 28msec Blog: http://28.io/blog
• Full Text Search Specs: http://www.w3.org/TR/xpath-full-
text-10/