NoSQL Concepts live Astrid Ritscher 29.1.2014 Buchhandlung Lehmanns
Oct 18, 2014
NoSQLConcepts liveAstrid Ritscher
29.1.2014 Buchhandlung Lehmanns
Astrid RitscherPrincipal [email protected]
Acando GmbHBusiness Area NordMillerntorplatz 120359 HamburgGermany
Acando GmbH
Agenda
NoSQL
SQL
Graph oriented
Persistence
Key value
Flexible Schema
Performance
Scalability
Document oriented MongoDB
Couchbase
ArangoDB
Neo4j
Cassandra
Acando GmbH
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
album : Neon Bible
artist : Arcade Fire
track count : 11
_id : 435
name : Keep The Car Running
genre : Rock
track number : 2
Acando GmbH
Document oriented General Purpose Open Source Community Driven Commodity Hardware
Acando GmbH
MongoDB Customers
Acando GmbH
Schema
Collection Document JSON/BSON
{! "_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"! ! }, ...! ]}
Acando GmbH
Schema vs. Relationalalbum
album
album artist
track count
_id
tracks
name
composer
_id
name
composer
genre
_id
album
id
album
album artist
track count
track
id
name
composer
genre
album_id
track
id
name
composer
genre
album_id
Acando GmbH
Live
Acando GmbH
start mongod,
show insert, find, update and delete
Aggregation
> db.tracks.aggregate( {$group: { _id : "$Genre", tracks:{$sum:1}}}, {$sort: {tracks:-1}}, {$limit:5} )
SELECT genre, count(genre) FROM tracks GROUP BY genreORDER BY count(genre) DESCLIMIT 5
Acando GmbH
Performance
http://idcdocserv.com/1414 (28.1.2014)
Horizontal Scalability: Sharding
Acando GmbH
mongod mongod mongod
Sharding
mongod
mongod
mongod
Acando GmbH
Shard 2Shard 1 Shard 3Config
Router
mongodmongod mongod mongod
mongos
Sharding
Your Application
Native Driver
Acando GmbH
Shard 2
Sharding
Shard Collection: tracksShard Key: Artist
Shard 1
chunk 2
Shard 3
chunk 1
chunk 3
chunk 4
chunk 2chunk 1 chunk 3 chunk 4
A-B C-F G-T U-Z
Acando GmbH
Live
Acando GmbH
start shard, config server and router
initialize sharding for a collection
show shard distribution and chunks
Shard 2Shard 1 Shard 3Config
Router
mongos mongos
mongod
mongod
mongod
mongod
mongod
mongod
mongod
mongod
mongod
mongod
mongod
mongos
Sharding in Production
mongod
Your Application
Native Driver
Acando GmbH
Conclusions
RDBMS Document oriented
Fixed Schema Flexible Schema
Joins No Joins
Transactionsno Transactions over
Collections
Vertically scalable Horizontally scalable by Sharding
Acando GmbH
Astrid RitscherPrincipal [email protected]
Acando GmbHBusiness Area NordMillerntorplatz 120359 HamburgGermany
Acando GmbH
Literature
NoSQL Distilledvon Pramodkumar J. Sadalage; Martin Fowler
Auflage:Jahr: 2012ISBN: 9780321826626
Verlag: Addison-Wesley Educational..Produkt-Art: Softcover
MongoDB Applied Design Patternsvon Rick CopelandPractical Use Cases with the Leading NoSQL DatabaseAuflage:Jahr: 2013ISBN: 9781449340049
Verlag: O'Reilly Media, Inc, USAProdukt-Art: Softcover
Acando GmbH
Literature
MongoDB: The Definitive Guidevon Kristina ChodorowPowerful and Scalable Data StorageAuflage: 2Jahr: 2013ISBN: 9781449344689
Verlag: O'Reilly Media, Inc, USAProdukt-Art: Softcover
Acando GmbH