the nosql landscape – document databases · 2018-06-26 · •the document model has benefits...

26
Technology Summit 30 June 2015, London Innovation for growing your business The NoSQL landscape – Document Databases Stefan Wittmann Product Manager

Upload: others

Post on 13-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Technology Summit 30 June 2015, London

Innovation for growing your business

The NoSQL landscape –Document DatabasesStefan Wittmann – Product Manager

Page 2: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

The NoSQL landscape

Page 3: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Database Landscape

Page 4: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Data Model Example Requirements Example Uses

Key-value and column Availability, scale and

speed

Big data capture, caching

Document Indexing ability and model

flexibility

Agile (mobile) app

development, mixed data

analytics

NewSQL Consistency Scaling out established

apps

Graph Articulated relationships Analyzing and supporting

social networks,

knowledge intensive

environments

Page 5: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• Proprietary Query Language (No SQL)

• No universal usage

Adoption Barriers

10.000.000

2.000

Page 6: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Our offering

Page 7: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• In addition to the data models we already support we are working

on even more data models:

– Key-Value

– Document

– Graph

Support for new data models

Page 8: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Focus: Document Data Model

Page 9: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• The document model has benefits suited for specific use cases

– Flexibility and Ease-of-Use

• Schemas don’t have to be defined upfront (or ever) and therefore

application developers can quickly setup work environments for their data

and easily adapt to changes in data structure.

– Sparseness

• Attributes with a particular key may appear in some documents within a

collection, but not in others.

– Hierarchical Data

• Structured types may be arrays or objects, nested arbitrarily deep. Data is

stored de-normalized in contrast to relational systems where data is stored

normalized.

– Dynamic Typing

• Values for a particular key have no fixed data type and may vary from

document to document.

Focus on Documents

Page 10: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have
Page 11: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• Built on two structures

• Collection of name/value pairs

• Ordered list of values

What is a document?

Page 12: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

{

"Name" : "John Smith",

"address" : {

"streetAddress": "21 2nd Street",

"city" : "New York",

"state" : "NY",

"postalCode" : 10021

},

"phoneNumber" :

[

{ "type" : "home", "number": "212 555-1234" },

{ "type" : "fax", "number": "646 555-4567" }

]

}

JSON representation

What does a document look like?

Page 13: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Real World

Page 14: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

Relational approach

Page 15: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

{

„id“:1,

„type“:“meter“,

„timestamp“:“2015-01-01 15:03“

„details“:1

}

{

„id“:1,

„confidence“:3,

„status“:2,

„value“:12345

}

Document Model approach

{

„id“:1,

„type“:“meter“,

„timestamp“:“2015-01-01 15:03“

„details“: {

„confidence“:3,

„status“:2,

„value“:12345

}

}

Page 16: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• Java

• .NET

• Node.js

• COS

• REST

Client Drivers

Page 17: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• JavaScript Object Notation (popularly known as JSON)

[RFC4627] is becoming increasingly important in Web- and

Cloud-based communities for exchanging data between Web-

based applications. This has in turn led to the demands for

storage, retrieval, querying, and manipulation of JSON data in the

context of SQL It is important that SQL respond to these

requirements by providing appropriate extensions for

handling JSON data.

• The SQL/JSON proposals address this comment.

• http://jtc1bigdatasg.nist.gov/_workshop/08_SQL_Support_for_JSON_abstract.pdf

SQL Standard

Page 18: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• No proprietary query language

• We follow a SQL centric approach

– Very close to the draft of the SQL standard committee for JSON SQL

integration

– Set of functions to construct JSON

– Set of functions to query collections

Querying documents

Page 19: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• Construct JSON documents from SQL query results :

– JSON_OBJECT

– JSON_OBJECTAGG

– JSON_ARRAY

– JSON_ARRAYAGG

Publishing JSON

Page 20: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• This query returns one row for each department recorded in the

DEPTS table.

• That row contains a single column, which contains a serialization

of a JSON object having the department number and name.

SELECT

JSON_OBJECT( 'deptno' : deptno, 'deptname' : deptname )

FROM depts

{ "deptno" : 314,"deptname" : "Engineering" }

JSON_OBJECT

Page 21: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• This query returns a JSON object with key value pairs composed

from two columns.

• SELECT JSON_OBJECTAGG (deptname, deptno) FROM depts

• { "Engineering" : 314, "Architecture" : 113, "Accounting" : 12,

"Sales" : 7, "Executives" : 13 }

JSON_OBJECTAGG

Page 22: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• SQL built-in functions for querying JSON data

– JSON_TABLE: returns a SQL table

– JSON_QUERY: returns a SQL string value that corresponds to

a JSON object or a JSON array

– JSON_VALUE: returns a SQL scalar value

• New SQL predicates applicable on JSON data

– IS JSON

– JSON_EXISTS

Querying JSON data

Page 23: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

SELECT TOP 10 Name, DOB

FROM JSON_TABLE(

‘People’,

‘{“columns”:

[

{“column”:”Name”,”path”:”$.Name”,”type”:”varchar(50)”},

{“column”:”DOB”,”path”:”$.DOB”,”type”:”DATE”}

]

}’)

ORDER BY Name DESC

Querying a collection

Name DOB

Zimmerman, Norbert Q. 06/02/1938

Yezek, Dave P. 09/16/2005

… …

Page 24: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

The Real WorldWhy this matters

Page 25: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

• Accept unplanned/unknown data

• Agile Development

• Handle sparse data efficiently

• Fluid data types

• Handle user-defined data

Use Cases

Page 26: The NoSQL landscape – Document Databases · 2018-06-26 · •The document model has benefits suited for specific use cases –Flexibility and Ease-of-Use •Schemas don’t have

A sneak peek