NoSQL

Concepts live
Astrid Ritscher
29.1.2014
Buchhandlung Lehmanns
Astrid Ritscher
Principal Consultant
astrid.ritscher@acando.de
Acando GmbH
Business Area Nord
Millerntorplatz 1
20359 Hamb...
Agenda
Persistence

SQL

Couchbase

Document
oriented
Key value

ArangoDB

Performance

Graph
oriented

NoSQL

MongoDB

Fl...
NoSQL
.. is (not only) an answer
to Big Data with focus on
performance and
scalability.
© Acando GmbH
Document oriented
albums
tracks

Documents
© Acando GmbH
Document oriented
track
_id : 435
album : „Neon Bible“
artist : „Arcade Fire“
track count : 11
track number : 2
name : „Ke...
• Document oriented
• General Purpose
• Open Source
• Community Driven
• Commodity Hardware
© Acando GmbH
MongoDB Customers

© Acando GmbH
Schema
• Collection
• Document
• JSON/BSON
© Acando GmbH

{
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
}

"_id" : 123,
"Album" ...
Schema vs. Relational
album

album

_id

id
album

album

album artist

album artist

track count

track count
tracks

tra...
Live
start mongod,
show insert, find, update
and delete

© Acando GmbH
Aggregation
SELECT genre, count(genre) FROM tracks
GROUP BY genre
ORDER BY count(genre) DESC
LIMIT 5

> db.tracks.aggregat...
Performance

http://idcdocserv.com/1414 (28.1.2014)

Horizontal Scalability:
Sharding
© Acando GmbH
Sharding
mongod

mongod

mongod

© Acando GmbH

mongod

mongod

mongod
Sharding
Your Application
Native Driver

Router
mongos

Config
mongod

© Acando GmbH

Shard 1
mongod

Shard 2
mongod

Shard...
Sharding
Shard Collection: tracks
Shard Key: Artist
A-B

C-F

G-T

U-Z

chunk 1

chunk 2

chunk 3

chunk 4

Shard 1
chunk ...
Live
start shard, config server and
router
initialize sharding for a collection
show shard distribution and
chunks

© Acand...
Sharding in Production
Your Application
Native Driver

Router
mongos

Config

Shard 1

mongos

Shard 2

mongos

Shard 3

mo...
Conclusions
RDBMS
Fixed Schema

Flexible Schema

Joins

No Joins

Transactions

no Transactions over
Collections

Vertical...
Astrid Ritscher
Principal Consultant
astrid.ritscher@acando.de
Acando GmbH
Business Area Nord
Millerntorplatz 1
20359 Hamb...
Literature
NoSQL Distilled
von Pramodkumar J. Sadalage; Martin Fowler
Auflage:
Jahr: 2012
ISBN: 9780321826626
Verlag: Addi...
Literature
MongoDB: The Definitive Guide
von Kristina Chodorow
Powerful and Scalable Data Storage
Auflage: 2
Jahr: 2013
IS...
Upcoming SlideShare
Loading in …5
×

NoSQL Concepts live with MongoDB

2,556 views

Published on

This talk shows and demonstrates concepts of a document-oriented NoSQL database. Flexible database schema, transaction model, performance by horizontal scalability and agile development will be explained and demonstrated in MongoDB. How dows a document look like in MongoDB? How are documents being searched? Which concepts are the basis of sharding? How are data replicated? This session gives short and vivid answers.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,556
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

NoSQL Concepts live with MongoDB

  1. 1. NoSQL Concepts live Astrid Ritscher 29.1.2014 Buchhandlung Lehmanns
  2. 2. Astrid Ritscher Principal Consultant astrid.ritscher@acando.de Acando GmbH Business Area Nord Millerntorplatz 1 20359 Hamburg Germany © Acando GmbH
  3. 3. Agenda Persistence SQL Couchbase Document oriented Key value ArangoDB Performance Graph oriented NoSQL MongoDB Flexible Schema Cassandra Scalability Neo4j © Acando GmbH
  4. 4. NoSQL .. is (not only) an answer to Big Data with focus on performance and scalability. © Acando GmbH
  5. 5. Document oriented albums tracks Documents © Acando GmbH
  6. 6. Document oriented track _id : 435 album : „Neon Bible“ artist : „Arcade Fire“ track count : 11 track number : 2 name : „Keep The Car Running“ genre : „Rock“ © Acando GmbH
  7. 7. • Document oriented • General Purpose • Open Source • Community Driven • Commodity Hardware © Acando GmbH
  8. 8. MongoDB Customers © Acando GmbH
  9. 9. Schema • Collection • Document • JSON/BSON © Acando GmbH { ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! } "_id" : 123, "Album" : "Neon Bible", "Album Artist" : "Arcade Fire", "Disc Count" : 1, "Track Count" : 11, "Tracks" : [ ! { ! ! "_id" : 733, ! ! "Name" : "Black Mirror", ! ! "Composer" : "Richard Reed Parry", ! ! "Genre" : "Rock" ! }, ! { ! ! "_id" : 735, ! ! "Name" : "Keep The Car Running", ! ! "Composer" : "Arcade Fire", ! ! "Genre" : "Rock" ! }, ... ]
  10. 10. Schema vs. Relational album album _id id album album album artist album artist track count track count tracks track track _id _id id id name name name name composer composer composer composer genre genre genre album_id album_id © Acando GmbH
  11. 11. Live start mongod, show insert, find, update and delete © Acando GmbH
  12. 12. Aggregation SELECT genre, count(genre) FROM tracks GROUP BY genre ORDER BY count(genre) DESC LIMIT 5 > db.tracks.aggregate( {$group: { _id : "$Genre", tracks:{$sum:1}}}, {$sort: {tracks:-1}}, {$limit:5} ) © Acando GmbH
  13. 13. Performance http://idcdocserv.com/1414 (28.1.2014) Horizontal Scalability: Sharding © Acando GmbH
  14. 14. Sharding mongod mongod mongod © Acando GmbH mongod mongod mongod
  15. 15. Sharding Your Application Native Driver Router mongos Config mongod © Acando GmbH Shard 1 mongod Shard 2 mongod Shard 3 mongod
  16. 16. Sharding Shard Collection: tracks Shard Key: Artist A-B C-F G-T U-Z chunk 1 chunk 2 chunk 3 chunk 4 Shard 1 chunk 1 chunk 3 © Acando GmbH Shard 2 chunk 2 Shard 3 chunk 4
  17. 17. Live start shard, config server and router initialize sharding for a collection show shard distribution and chunks © Acando GmbH
  18. 18. Sharding in Production Your Application Native Driver Router mongos Config Shard 1 mongos Shard 2 mongos Shard 3 mongod mongod mongod mongod mongod mongod mongod mongod © Acando GmbH mongod mongod mongod mongod
  19. 19. Conclusions RDBMS Fixed Schema Flexible Schema Joins No Joins Transactions no Transactions over Collections Vertically scalable © Acando GmbH Document oriented Horizontally scalable by Sharding
  20. 20. Astrid Ritscher Principal Consultant astrid.ritscher@acando.de Acando GmbH Business Area Nord Millerntorplatz 1 20359 Hamburg Germany © Acando GmbH
  21. 21. Literature NoSQL Distilled von Pramodkumar J. Sadalage; Martin Fowler Auflage: Jahr: 2012 ISBN: 9780321826626 Verlag: Addison-Wesley Educational.. Produkt-Art: Softcover MongoDB Applied Design Patterns von Rick Copeland Practical Use Cases with the Leading NoSQL Database Auflage: Jahr: 2013 ISBN: 9781449340049 Verlag: O'Reilly Media, Inc, USA Produkt-Art: Softcover © Acando GmbH
  22. 22. Literature MongoDB: The Definitive Guide von Kristina Chodorow Powerful and Scalable Data Storage Auflage: 2 Jahr: 2013 ISBN: 9781449344689 Verlag: O'Reilly Media, Inc, USA Produkt-Art: Softcover © Acando GmbH

×