A Tour of the NoSQL World
David Cassel, MarkLogic Sr. Consultant
7 Nov 2011
Slide 1
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Why NoSQL?
RDBMSes are
• familiar
• ubiquitous
• backed by a body
of research
Slide 2
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Why NoSQL?
doc
meta
title
abstract
content
chapter
Database
Server Server Server
Slide 3
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
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
Slide 4
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
What is NoSQL?
Slide 5
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Graph Databases
Mark
Logic
Dave
Dawn
Slide 6
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
status
Chris
Key-Value Store
app_setting_width
user1923_color
user1923_age
user3371_color
user4344_color
user1923_height
user3371_age
error_msg_457
error_message_1
1923_name
user1923_name
user1923_lname
Application_Installed
log_errors
install_path
ServerName
test
test1
test123
devonly
wonderwoman
value
450
Red
18
Blue
Brackish
6' 0"
34
There is no file %1 here
There is no user with %1 name
Jim
Jim Smith
Smith
true
1
C:\Windows\System32\Restricted
localhost
test
test
Brackish
key
http://dba.stackexchange.com/questions/607/what-is-a-key-value-store-database
Slide 7
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Column Stores
id
first
last
zip
23
Bugs
Bunny
48389
983
Foghorn
Leghorn
19394
420
Marvin
Martian
04829
185
Elmer
Fudd
25749
23,Bugs,Bunny,48389
983,Foghorn,Leghorn,19394
420,Marvin,Martian,04829
185,Elmer,Fudd,25749
Slide 8
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
23,983,420,185
Bugs,Foghorn,Marvin,Elmer
Bunny,Leghorn,Martian,Fudd
48389,19394,04829,25749
Document Store
/posts/a-custom-facet-for-the-search-api.xml
<post>
…
</post>
/posts/unparsing-a-custom-facet.xml
<post>
…
</post>
Slide 9
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Querying a Document Store
Slide 10
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
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>
Slide 11
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
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);
Slide 12
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Scaling
Scale Up
Scale Out
Slide 13
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Growing the database
Slide 14
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
No Schema
New Requirement:
Our company has acquired a small publishing
house. Put their publications in the database with
our existing ones.
Slide 15
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Does all this help?
Slide 16
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
ACID properties
tomicity
A I
onsistency
solation
Curability
D
Slide 17
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
ACID -- Atomicity
Remove $
from A
Slide 18
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Add $ to B
Complete
Transaction
ACID -- Consistency
/content/foo.xml
id Name Job
1
Dave
Developer
1
Bob
Sales
1
2
Slide 19
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
ACID -- Isolation
Write
Write
Done
t=2
t=3
Read
t=0
t=1
Dirty reads
Non-repeatable reads
Phantom reads
Slide 20
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
ACID – Durability
RAM
Slide 21
Journal
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Disk
NoSQL Support
Slide 22
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
Where does MarkLogic fit?
tomicity
A I
onsistency
solation
Curability
D
Enterprise Level
(100s of terabytes)
Express License
Slide 23
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
The Other Side of the Coin
Variety
Architecture (yay!)
Maturity
Administration
Tool support
Knowledgeable developers
Support
Open Source – support companies
Commercial – MarkLogic
Slide 24
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
NoSQL means:
The Right Tool for the Job
Blog: http://blog.davidcassel.net
Twitter: @dmcassel
Slide 25
Copyright © 2011 MarkLogic® Corporation. All rights reserved.
© Copyright 2026 Paperzz