Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
aggregate is the new find: real time analytics with MongoDB
1.
2. Was ist mongoDB?
• mongoDB ist eine Open-Source, dokument-orientierte Datenbank, die für einfaches entwickeln und skalieren
konzipiert wurde.
• mongoDB kommt vom englischen Begriff "humongous", der auf Deutsch mit "gigantisch" beziehungsweise
"riesig" übersetzt wird.
• mongoDB verzichtet auf eine Abfragesprache wie SQL. Stattdessen erfolgen die Datenmanipulation und -Abfrage
anhand von Objektspezifischen Methoden, die für alle gängige Programmiersprachen verfügbar sind.
• Im Gartner Magic Quadrant für "Operational Database Management Systems" spielt mongoDB in einer Liga mit
Oracle, Microsoft, AWS und SAP.
https://www.gartner.com/reviews/market/operational-dbms
• In der „Forrester Wave™: Big Data NoSQL“ wird mongoDB seit Q3, 2016 als „Leader“ geführt.
https://resources.mongodb.com/migrating-to-mongodb/the-forrester-wave-big-data-nosql-q3-2016
• Im Ranking von db-engines.com für Document Stores liegt mongoDB weit vor (Amazon Dynamo DB, Couchbase,
CouchDB und Microsoft Azure CosmosDB
https://db-engines.com/de/ranking/document+store
9. Beispiel Aggregation Pipelines
db.zipcodes.aggregate(
[
{ $group: { _id: { state: "$state", city: "$city" }, pop: { $sum: "$pop" } } },
{ $group: { _id: "$_id.state", avgCityPop: { $avg: "$pop" } } }
]
)
durchschnittliche Einwohnerzahl der Städte nach Staaten
https://docs.mongodb.com/manual/tutorial/aggregation-zip-code-data-set/
SELECT
subsel.state, avg(subsel.pop) AS avgCityPop
FROM
( SELECT state, city, sum(pop) AS pop FROM zipcodes GROUP BY state, city ) AS subsel
GROUP BY
subsel.state
Rot - Funktionsaufruf
Blau - Felder des ursprünglichen Dokumentes
Grün - Felder des Subselects
13. Vielen Dank für Ihre Aufmerksamkeit
Ihr Referent und das Team von
IT-Schulungen.com
Fon +49 (0) 911 650 08 - 30
Fax +49 (0) 911 650 08 - 399
Mail info@it-schulungen.com
Web www.it-schulungen.com
Education Center der New Elements GmbH
Thurn-und-Taxis-Straße 10
90411 Nürnberg
www.newelements.de