SlideShare ist ein Scribd-Unternehmen logo
1 von 13
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
MongoDB Replikation und Clustering
BSON (Binary JSON) Dokumente
Optionen für Aggregationen
voraggregieren woanders aggregieren in mongoDB aggregieren
Old School (Map Reduce)
Map-Funktion Reduce Funktion
mongoDB Document Pipeline
$match | $group | $sort
Input Stream {} {} {} {} {} Result Output
Pipeline Stages
{
state: "Texas",
city: "San Antonio",
pop: 746500
}
{
state: "Texas",
city: "San Antonio",
pop: 746500
}
{
state: "Texas",
city: "Austin",
pop: 911390
}
{
state: "Kalifornien",
city: "Los Angeles",
pop: 3976000
}
{
_id: { state: "Texas",
city: "San Antonio"},
pop: 1493000
}
{
_id: { state: "Texas",
city: "Austin"},
pop: 911390
}
{
_id: { state: "Kalifornien",
city: "Los Angeles"},
pop: 3976000
}
$group, $sum
{
_id: "Texas",
avgCityPop : 1202195
}
{
_id: "Kalifornien",
avgCityPop : 3976000
}
$group, $avg
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
Aggregation Pipeline Builder
Lab: Verbindung herstellen
Lab: Abfragen ausführen
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

Weitere ähnliche Inhalte

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
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
  • 4. BSON (Binary JSON) Dokumente
  • 5. Optionen für Aggregationen voraggregieren woanders aggregieren in mongoDB aggregieren
  • 6. Old School (Map Reduce) Map-Funktion Reduce Funktion
  • 7. mongoDB Document Pipeline $match | $group | $sort Input Stream {} {} {} {} {} Result Output
  • 8. Pipeline Stages { state: "Texas", city: "San Antonio", pop: 746500 } { state: "Texas", city: "San Antonio", pop: 746500 } { state: "Texas", city: "Austin", pop: 911390 } { state: "Kalifornien", city: "Los Angeles", pop: 3976000 } { _id: { state: "Texas", city: "San Antonio"}, pop: 1493000 } { _id: { state: "Texas", city: "Austin"}, pop: 911390 } { _id: { state: "Kalifornien", city: "Los Angeles"}, pop: 3976000 } $group, $sum { _id: "Texas", avgCityPop : 1202195 } { _id: "Kalifornien", avgCityPop : 3976000 } $group, $avg
  • 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