A Tour of the NoSQL World

25
Slide 1 Copyright © 2011 MarkLogic ® Corporation. All rights reserved. Slide 1 A Tour of the NoSQL World David Cassel, MarkLogic Sr. Consultant 7 Nov 2011

description

A Tour of the NoSQL World. David Cassel, MarkLogic Sr. Consultant 7 Nov 2011. Why NoSQL ?. RDBMSes are familiar. ubiquitous. backed by a body of research. Why NoSQL ?. What is NoSQL ?. - PowerPoint PPT Presentation

Transcript of A Tour of the NoSQL World

Page 1: A Tour of the  NoSQL  World

Slide 1 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 1

A Tour of the NoSQL WorldDavid Cassel, MarkLogic Sr. Consultant7 Nov 2011

Page 2: A Tour of the  NoSQL  World

Slide 2 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 2

Why NoSQL?

RDBMSes are• familiar

• ubiquitous

• backed by a body of research

Page 3: A Tour of the  NoSQL  World

Slide 3 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 3

Why NoSQL?

Page 4: A Tour of the  NoSQL  World

Slide 4 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 4

What is NoSQL?

• "NoSQL refers to a class of databases 1) are intended to perform at internet (Facebook, Twitter, LinkedIn) scale and 2) reject the relational model in favor of other (key-value, document, graph) models." -- http://www.greenhornconnect.com/blog/dan-croak-what-nosql

• "Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable. The original intention has been modern web-scale databases. … Often more characteristics apply as: schema-free, easy replication support, simple API, eventually consistent /BASE (not ACID), a huge data amount, and more." -- http://nosql-database.org/

• "NoSQL (sometimes expanded to "not only SQL") is a broad class of database management systems that differ from classic relational database management systems (RDBMSes)…. These data stores may not require fixed table schemas, usually avoid join operations, and typically scale horizontally." -- Wikipedia

Page 5: A Tour of the  NoSQL  World

Slide 5 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 5

What is NoSQL?

Page 6: A Tour of the  NoSQL  World

Slide 6 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 6

Graph Databases

Dave

Dawn Chris

statusMarkLogic

Page 7: A Tour of the  NoSQL  World

Slide 7 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 7

Key-Value Storeapp_setting_width 450user1923_color Reduser1923_age 18user3371_color Blueuser4344_color Brackishuser1923_height 6' 0"user3371_age 34error_msg_457 There is no file %1 hereerror_message_1 There is no user with %1 name1923_name Jimuser1923_name Jim Smithuser1923_lname SmithApplication_Installed truelog_errors 1install_path C:\Windows\System32\RestrictedServerName localhosttest testtest1 testtest123 Brackishdevonlywonderwomanvalue key

http://dba.stackexchange.com/questions/607/what-is-a-key-value-store-database

Page 8: A Tour of the  NoSQL  World

Slide 8 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 8

Column Stores

id first last zip23 Bugs Bunny 48389983 Foghorn Leghorn 19394420 Marvin Martian 04829185 Elmer Fudd 25749

23,Bugs,Bunny,48389983,Foghorn,Leghorn,19394420,Marvin,Martian,04829185,Elmer,Fudd,25749

23,983,420,185Bugs,Foghorn,Marvin,ElmerBunny,Leghorn,Martian,Fudd48389,19394,04829,25749

Page 9: A Tour of the  NoSQL  World

Slide 9 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 9

Document Store

/posts/a-custom-facet-for-the-search-api.xml

<post> …</post>

/posts/unparsing-a-custom-facet.xml <post> …</post>

Page 10: A Tour of the  NoSQL  World

Slide 10 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 10

Querying a Document Store

Page 11: A Tour of the  NoSQL  World

Slide 11 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 11

Querying a Document Store

<post> <meta> <title>A custom facet for the Search API</title> <author>David Cassel</author> <published>2011-07-27</published> <summary>…</summary> <tags> <tag>marklogic</tag> <tag>search api</tag> </tags> <category>Software Development</category> </meta> <text>…</text></post>

Page 12: A Tour of the  NoSQL  World

Slide 12 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 12

Querying a Document Store

cts:search(/blog, cts:and-query(( cts:word-query(“facet”) cts:near-query(( cts:word-query(“search api”) cts:word-query(“custom”)), 10) ))) db.things.find({name:"mongo"

}).forEach(printjson);

Page 13: A Tour of the  NoSQL  World

Slide 13 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 13

Scaling

Scale Up

Scale Out

Page 14: A Tour of the  NoSQL  World

Slide 14 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 14

Growing the database

Page 15: A Tour of the  NoSQL  World

Slide 15 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 15

No Schema

New Requirement: Our company has acquired a small publishing

house. Put their publications in the database with our existing ones.

Page 16: A Tour of the  NoSQL  World

Slide 16 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 16

Does all this help?

Page 17: A Tour of the  NoSQL  World

Slide 17 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 17

ACID properties

A C I D

tomicity

onsistency

solation

urability

Page 18: A Tour of the  NoSQL  World

Slide 18 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 18

ACID -- Atomicity

Page 19: A Tour of the  NoSQL  World

Slide 19 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 19

ACID -- Consistency

/content/foo.xmlid

Name

Job

1 Dave Developer1 Bob Sales

1

2

Page 20: A Tour of the  NoSQL  World

Slide 20 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 20

ACID -- Isolation

Write DoneWrite

Read

t=0 t=1 t=2 t=3

Dirty readsNon-repeatable readsPhantom reads

Page 21: A Tour of the  NoSQL  World

Slide 21 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 21

ACID – Durability

RAM Journal Disk

Page 22: A Tour of the  NoSQL  World

Slide 22 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 22

NoSQL Support

Page 23: A Tour of the  NoSQL  World

Slide 23 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 23

Where does MarkLogic fit?

A C I D

tomicity

onsistency

solation

urability

Express License

Enterprise Level (100s of terabytes)

Page 24: A Tour of the  NoSQL  World

Slide 24 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 24

The Other Side of the Coin

Variety Architecture (yay!)

Maturity Administration Tool support Knowledgeable developers

Support Open Source – support companies Commercial – MarkLogic

Page 25: A Tour of the  NoSQL  World

Slide 25 Copyright © 2011 MarkLogic® Corporation. All rights reserved.Slide 25

NoSQL means:The Right Tool for the Job

Blog: http://blog.davidcassel.netTwitter: @dmcassel