SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
MONGO DB IM
                            EINSATZ
                            Ein kleiner Einblick


                                                   Nils Domrose




Sunday, November 20, 11
ÜBER MONGO DB
          WWW.MONGODB.ORG


              Dokumentenorientierte Datenbank (Document Storage)

              In C++ geschrieben

              High Availability Setups

              Auto Sharding

              MapReduce

              GridFS

              Projekt der Firma 10gen verfügbar unter GPL v3

                                                                   Bilder Quelle: http://www.mongodb.org


Sunday, November 20, 11
WARUM MONGODB?

              einfache Installation Konfiguration und Administration

              Migrationspfad für bestehenden Installationen

              Recht Universell einsetzbar, viele nützlich Funktionen

              Skalierbar

              Schnelle Weiterentwicklung (i.e. Datacenter aware Replication)

              Einfaches Interface mächtiger Syntax viele mitgelieferte Tools

              gute Dokumentation und wachsende Community



Sunday, November 20, 11
HELLO MONGODB
       1. Download für verschieden Platformen unter
          http://www.mongodb.org/downloads

       2. start des mongod Prozesses

       3. aufrufen des command line Clients “mongo”




Sunday, November 20, 11
ERSTE SCHRITTE
          TABLE = COLLECTION = SCHEMALOSE SAMMLUNG VON DOKUMENTEN



              Wechseln in eine DatenBank: >use testdb

              Einfügen eines Documents in eine Collection:
              >db.test_col.insert({test: ‘mytest data’})

              Suchen eines Documents
              >db.test_col.find({test: ‘mytest data’})

              Hilfe: >db.help()

              Datenbanken, Schemas und Collections müssen nicht
              angelegt werden!

Sunday, November 20, 11
MÖGLICHE SETUPS
              Replica Set   Sharding Setup




                                      Bilder Quelle: http://www.mongodb.org


Sunday, November 20, 11
REPLICA SET VS.
          SHARDING
                          Replica Sets                      Sharding
              Daten werden auf mehere Server          Daten werden automatisch auf N
              (Slaves) verteilt                       shards verteilt

              Client kann sicherstellen, dass Daten   in Kombination mit Relica Sets
              auf N Server repliziert wurden          werden die Daten dann repliziert

              Writes finden auf dem Master statt      Writes auf alle Shard Server

              Reads können optional pro query         Reads optional auf allen Servern
              verteilt werden, müssen aber nicht
                                                      Config Server halten Metadaten
              Automatische Failover im Fehler Fall
                                                      Router Prozess verteilt Requests


Sunday, November 20, 11
MONGODB IM EINSATZ
        Multi Purpose Backend Datenbank als Replica Set für:

              Echtzeit Statistiken

              Subscription Engine (Push)

              Realtime Debugging und Error Reporting

              Distributed File System

              JSON Fallback Cache

              Geo Placemarks

              Accounting


Sunday, November 20, 11
ECHTZEIT
          STATISTIKEN
              inline Erfassung von Statistkdaten


              unique User Reporting Monat, Tag, Jahr


              Requests pro Modul pro App pro
              Useragent pro Stunde, Tag, Monat, Jahr
              etc.


              eine “upsert” Datenbank operation auf
              einem sehr grossen Objekt mit vielen
              increments (usage Stats)


              Ersetzt zu grossen Teilen Reporting
              Cron Jobs




Sunday, November 20, 11
DEBUGGING UND
          ERROR LOGGING
              Inline Debugging

              Inline Error Reporting (komplettes
              Erfassen des aktuellen Requests)

              Caped Collections mit fester Grösse -
              > kein Überlaufen

              die ältesten Einträge werden bei
              bedarf gelöscht

              Platte kann nicht “voll laufen”

              Ersetzt Error logging


Sunday, November 20, 11
GEO DATEN UND
          MONGO
              >db.places.insert({loc: {lat: 50, lon: 50}})

              >db.places.ensureIndex( { loc : "2d" } , { bits : 26 } )

              >db.places.find( { loc : { $near : [50,50] , $maxDistance :
              5 } } ).limit(20)



              Placemark Server ohne eine Zeile Code!



Sunday, November 20, 11
WAS GEFÄLLT

              Konfiguration

              Wartung, Failover, Recovery, Status Infos, Logging

              Capped Collections

              Geo Index

              Grid FS multiple Version for each file

              Performance und Erweiterbarkeit


Sunday, November 20, 11
WORAUF MAN ACHTEN
          SOLLTE


              64 bit - die 32bit Version kann nur 2,5 GB Daten verwalten

              BSON /JSON Document Limit aktuell 16MB vorher 4MB

              Default NameSpace Limit 24.000 / database (Collection und
              Index zählt dazu)




Sunday, November 20, 11
@endyman

                          nils@domrose.net




Sunday, November 20, 11

Contenu connexe

En vedette

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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
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...Applitools
 
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 WorkGetSmarter
 
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...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

En vedette (20)

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...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

MongoDb im Einsatz

  • 1. MONGO DB IM EINSATZ Ein kleiner Einblick Nils Domrose Sunday, November 20, 11
  • 2. ÜBER MONGO DB WWW.MONGODB.ORG Dokumentenorientierte Datenbank (Document Storage) In C++ geschrieben High Availability Setups Auto Sharding MapReduce GridFS Projekt der Firma 10gen verfügbar unter GPL v3 Bilder Quelle: http://www.mongodb.org Sunday, November 20, 11
  • 3. WARUM MONGODB? einfache Installation Konfiguration und Administration Migrationspfad für bestehenden Installationen Recht Universell einsetzbar, viele nützlich Funktionen Skalierbar Schnelle Weiterentwicklung (i.e. Datacenter aware Replication) Einfaches Interface mächtiger Syntax viele mitgelieferte Tools gute Dokumentation und wachsende Community Sunday, November 20, 11
  • 4. HELLO MONGODB 1. Download für verschieden Platformen unter http://www.mongodb.org/downloads 2. start des mongod Prozesses 3. aufrufen des command line Clients “mongo” Sunday, November 20, 11
  • 5. ERSTE SCHRITTE TABLE = COLLECTION = SCHEMALOSE SAMMLUNG VON DOKUMENTEN Wechseln in eine DatenBank: >use testdb Einfügen eines Documents in eine Collection: >db.test_col.insert({test: ‘mytest data’}) Suchen eines Documents >db.test_col.find({test: ‘mytest data’}) Hilfe: >db.help() Datenbanken, Schemas und Collections müssen nicht angelegt werden! Sunday, November 20, 11
  • 6. MÖGLICHE SETUPS Replica Set Sharding Setup Bilder Quelle: http://www.mongodb.org Sunday, November 20, 11
  • 7. REPLICA SET VS. SHARDING Replica Sets Sharding Daten werden auf mehere Server Daten werden automatisch auf N (Slaves) verteilt shards verteilt Client kann sicherstellen, dass Daten in Kombination mit Relica Sets auf N Server repliziert wurden werden die Daten dann repliziert Writes finden auf dem Master statt Writes auf alle Shard Server Reads können optional pro query Reads optional auf allen Servern verteilt werden, müssen aber nicht Config Server halten Metadaten Automatische Failover im Fehler Fall Router Prozess verteilt Requests Sunday, November 20, 11
  • 8. MONGODB IM EINSATZ Multi Purpose Backend Datenbank als Replica Set für: Echtzeit Statistiken Subscription Engine (Push) Realtime Debugging und Error Reporting Distributed File System JSON Fallback Cache Geo Placemarks Accounting Sunday, November 20, 11
  • 9. ECHTZEIT STATISTIKEN inline Erfassung von Statistkdaten unique User Reporting Monat, Tag, Jahr Requests pro Modul pro App pro Useragent pro Stunde, Tag, Monat, Jahr etc. eine “upsert” Datenbank operation auf einem sehr grossen Objekt mit vielen increments (usage Stats) Ersetzt zu grossen Teilen Reporting Cron Jobs Sunday, November 20, 11
  • 10. DEBUGGING UND ERROR LOGGING Inline Debugging Inline Error Reporting (komplettes Erfassen des aktuellen Requests) Caped Collections mit fester Grösse - > kein Überlaufen die ältesten Einträge werden bei bedarf gelöscht Platte kann nicht “voll laufen” Ersetzt Error logging Sunday, November 20, 11
  • 11. GEO DATEN UND MONGO >db.places.insert({loc: {lat: 50, lon: 50}}) >db.places.ensureIndex( { loc : "2d" } , { bits : 26 } ) >db.places.find( { loc : { $near : [50,50] , $maxDistance : 5 } } ).limit(20) Placemark Server ohne eine Zeile Code! Sunday, November 20, 11
  • 12. WAS GEFÄLLT Konfiguration Wartung, Failover, Recovery, Status Infos, Logging Capped Collections Geo Index Grid FS multiple Version for each file Performance und Erweiterbarkeit Sunday, November 20, 11
  • 13. WORAUF MAN ACHTEN SOLLTE 64 bit - die 32bit Version kann nur 2,5 GB Daten verwalten BSON /JSON Document Limit aktuell 16MB vorher 4MB Default NameSpace Limit 24.000 / database (Collection und Index zählt dazu) Sunday, November 20, 11
  • 14. @endyman nils@domrose.net Sunday, November 20, 11