NoSQL 
Konzepte live und in Farbe 
Astrid Ritscher 
! 
code.talks 2014 
! 
!
NoSQL - Antwort auf Big Data 
© Acando GmbH 
Volume Velocity 
Variety
NoSQL-Technologien 
© Acando GmbH 
Graphen Spalten Dokumente
• Document Oriented 
• General Purpose 
• Open Source 
• Community Driven 
• Commodity Hardware 
© Acando GmbH
Dokumentenorientierte 
NoSQL-Technologie 
albums 
© Acando GmbH
Relational vs. Flexibel 
album 
_id 
album 
album artist 
track count 
tracks 
_id 
name 
composer 
_id 
name 
composer 
genre 
album 
id 
album 
album artist 
track count 
track 
id 
name 
composer 
genre 
album_id 
track 
id 
name 
composer 
genre 
album_id 
© Acando GmbH
Flexibles Schema 
© 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" 
}, 
{ 
"_id" : 735, 
"name" : "Keep The Car Running", 
"composer" : "Arcade Fire“, 
"genre" : "Rock" 
} 
] 
} 
album 
_id 
album 
album artist 
track count 
tracks 
_id 
name 
composer 
_id 
name 
composer 
genre
Live 
© Acando GmbH 
start mongod server 
flexible data schema 
show: find, insert, update 
and remove
Performance 
© Acando GmbH 
Skalierbarkeit
Vertikale Skalierung 
© Acando GmbH
Horizontale Skalierung 
© Acando GmbH
MongoDB Server 
Your Application 
Native Driver 
mongod 
© Acando GmbH
Sharding 
Your Application 
Native Driver 
Router 
mongos 
Config Shard 1 Shard 2 Shard 3 
mongod mongod mongod mongod 
© Acando GmbH
Sharding 
Shard Collection: albums 
Shard Key: album artist 
© Acando GmbH 
album 
_id 
album 
album artist 
track count 
tracks 
_id 
name 
composer 
_id 
name 
composer 
genre
Sharding 
albums 
Shard Collection: albums 
Shard Key: album artist 
A-B C-F G-T U-Z 
chunk 1 chunk 2 chunk 3 chunk 4 
Shard 1 Shard 3 
chunk 1 
chunk 3 
chunk 4 
© Acando GmbH 
Shard 2 
chunk 2
Sharding 
Your Application 
Native Driver 
Router 
mongos 
Config Shard 1 Shard 2 Shard 3 
mongod mongod mongod mongod 
© Acando GmbH
© Acando GmbH 
Live 
start shard, config server and 
router 
initialize sharding for a collection 
show shard distribution and 
chunks
Sharding in Produktion 
Router 
Config Shard 1 Shard 2 Shard 3 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
Your Application 
Native Driver 
© Acando GmbH 
mongos mongos mongos mongos
© Acando GmbH 
NoSQL 
Konzepte live und in Farbe 
Astrid Ritscher

NoSQL Konzepte live und in Farbe

  • 1.
    NoSQL Konzepte liveund in Farbe Astrid Ritscher ! code.talks 2014 ! !
  • 2.
    NoSQL - Antwortauf Big Data © Acando GmbH Volume Velocity Variety
  • 3.
    NoSQL-Technologien © AcandoGmbH Graphen Spalten Dokumente
  • 4.
    • Document Oriented • General Purpose • Open Source • Community Driven • Commodity Hardware © Acando GmbH
  • 5.
  • 6.
    Relational vs. Flexibel album _id album album artist track count tracks _id name composer _id name composer genre album id album album artist track count track id name composer genre album_id track id name composer genre album_id © Acando GmbH
  • 7.
    Flexibles Schema ©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" }, { "_id" : 735, "name" : "Keep The Car Running", "composer" : "Arcade Fire“, "genre" : "Rock" } ] } album _id album album artist track count tracks _id name composer _id name composer genre
  • 8.
    Live © AcandoGmbH start mongod server flexible data schema show: find, insert, update and remove
  • 9.
    Performance © AcandoGmbH Skalierbarkeit
  • 10.
  • 11.
  • 12.
    MongoDB Server YourApplication Native Driver mongod © Acando GmbH
  • 13.
    Sharding Your Application Native Driver Router mongos Config Shard 1 Shard 2 Shard 3 mongod mongod mongod mongod © Acando GmbH
  • 14.
    Sharding Shard Collection:albums Shard Key: album artist © Acando GmbH album _id album album artist track count tracks _id name composer _id name composer genre
  • 15.
    Sharding albums ShardCollection: albums Shard Key: album artist A-B C-F G-T U-Z chunk 1 chunk 2 chunk 3 chunk 4 Shard 1 Shard 3 chunk 1 chunk 3 chunk 4 © Acando GmbH Shard 2 chunk 2
  • 16.
    Sharding Your Application Native Driver Router mongos Config Shard 1 Shard 2 Shard 3 mongod mongod mongod mongod © Acando GmbH
  • 17.
    © Acando GmbH Live start shard, config server and router initialize sharding for a collection show shard distribution and chunks
  • 18.
    Sharding in Produktion Router Config Shard 1 Shard 2 Shard 3 mongod mongod mongod mongod mongod mongod mongod mongod mongod mongod mongod mongod Your Application Native Driver © Acando GmbH mongos mongos mongos mongos
  • 19.
    © Acando GmbH NoSQL Konzepte live und in Farbe Astrid Ritscher